Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install log2jsconsole

How to install log2jsconsole

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install log2jsconsole
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3
0.4Never BuiltWhy not?
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
Windows (64-bit)
0.3
0.4Never BuiltWhy not?
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
Mac OS X (10.5+)
0.3
0.4Never BuiltWhy not?
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
Linux (32-bit)
0.3
0.4Never BuiltWhy not?
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
Linux (64-bit)
0.4 Available View build log
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
 
Author
License
MIT License
Dependencies
Imports
Lastest release
version 0.4 on Jan 9th, 2014
Safari Web Inspector Opera Dragonfly

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)

Or you can add this as a filter of Python Paste:

System Message: ERROR/3 (<string>, line 52)

Unknown directive type "code-block".

.. code-block:: ini

   [filter:log]
   use = egg:log2jsconsole
   auto_install = True

Changelog

Version 0.4

Released on June 7, 2013.

  • Support for Python Paste filter entry point. [#1 by Roberto De Almeida]
  • Fixed incompatibile signature (according to PEP 333) of start_response. [#1 by Roberto De Almeida]
Version 0.3

Released on November 28, 2011.

  • Fixed a bug of Content-Type detection.
Version 0.2

Released on November 28, 2011.

  • Fixed a bug of Content-Type detection.
Version 0.1

Initially released on November 26, 2011.

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.