With Pyjamas you can use full Python-style logging (Python's flexible event logging module has been ported to pyjs). Additional handlers allow you to display log messages in a dedicated div element in the HTML document, in the Web browser's error console, and with JavaScript's alert() function.
from pyjamas import logging log = logging.getConsoleLogger() # other loggers: Alert, Append, Print ... ... log.error("Hello, here is an %s error", err_name)
For a good understanding of the logging module read the Python Logging HOWTO; most of it directly applies to Pyjamas. Additional Loggers provided by Pyjamas, and how you'd use them:
log = logging.getAlertLogger()
log = logging.getAppendLogger()
log = logging.getConsoleLogger()
log = logging.getPrintLogger()
log = logging.getLoggerForHandler(NullHandler())
from pyjamas.logging.handlers import NullHandler