Skip to main content

Simple WSGI middleware that helps to log messages into JavaScript console object

Project description

http://i.imgur.com/jkYMB.png

It provides a simple WSGI middleware that helps to log messages into JavaScript console object. For example, if you log messages like:

logger = logging.getLogger('my.logger')
logger.warning('warning message')
logger.debug('debug message')

The middleware automatically appends codes like following JavaScript:

<script>
// <![CDATA[
if (console) {
  console.warn('my.logger: warning message');
  console.debug('my.logger: debug message');
}
// ]]>
</script>

Installation

You can install it by downloading from PyPI through pip or easy_install:

$ pip install log2jsconsole

How to use

Assume that your WSGI application name is app:

from yourapp import app
from log2jsconsole import LoggingMiddleware

app = LoggingMiddleware(app)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

log2jsconsole-0.2.tar.gz (2.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page