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 details)

Uploaded Source

File details

Details for the file log2jsconsole-0.2.tar.gz.

File metadata

  • Download URL: log2jsconsole-0.2.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for log2jsconsole-0.2.tar.gz
Algorithm Hash digest
SHA256 6df43138905ed3164664de6f0ac839f4cf867bcb9ad870915c7efc1dac3aa581
MD5 36d3ecba1c953db4676f70fda1390273
BLAKE2b-256 2bb2750864bdd81da96318b0a1daf2037f20b10b3bf3a479ca7b72e605c0f407

See more details on using hashes here.

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