gecko-dev/testing/mozbase/mozlog
2012-10-10 09:27:06 -07:00
..
mozlog Bug 799605 - Mirror mozbase -> m-c for bug 799288 and bug 799507 @ https://github.com/mozilla/mozbase/commit/ 36a2f63be33af799a54d7f1511dc922730b10b22 ; r=wlach 2012-10-10 09:27:06 -07:00
README.md Bug 775127 - Bump mozInstall version and release to pypi and update mozbase on mozilla central. r=ahalberstadt 2012-07-20 20:19:38 -04:00
setup.py Bug 788842 - Mirror mozbase to m-c, r=jhammel 2012-09-07 17:58:39 -07:00

Mozlog is a python package intended to simplify and standardize logs in the Mozilla universe. It wraps around python's logging module and adds some additional functionality.

Usage

Import mozlog instead of logging (all functionality in the logging module is also available from the mozlog module). To get a logger, call mozlog.getLogger passing in a name and the path to a log file. If no log file is specified, the logger will log to stdout.

import mozlog
logger = mozlog.getLogger('LOG_NAME', 'log_file_path')
logger.setLevel(mozlog.DEBUG)
logger.info('foo')
logger.testPass('bar')
mozlog.shutdown()