There is a script called fvlogger, which you can use to log text into portions of your webpage. This works similar to log4j logging. You can setup divs on your page that contain the text for different log levels. e.g. 1 div for warnings, 1 div for info. etc.
After setting up the divs you can call functions like warn() or info() instead of alert()