gecko-dev/testing/mozbase/mozlog
Siddharth Agarwal 18936b1386 Bug 769808 - Update mozbase on m-c to include fix for bug 769789. r=jhammel 2012-07-03 01:52:54 +05:30
..
mozlog Bug 769808 - Update mozbase on m-c to include fix for bug 769789. r=jhammel 2012-07-03 01:52:54 +05:30
README.md Bug 769808 - Update mozbase on m-c to include fix for bug 769789. r=jhammel 2012-07-03 01:52:54 +05:30
setup.py Bug 769808 - Update mozbase on m-c to include fix for bug 769789. r=jhammel 2012-07-03 01:52:54 +05:30

README.md

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