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.3.tar.gz (2.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page