skip to navigation
skip to content

Not Logged In

python-yaml-logger 0.3.1

YAML formatter for the standard Python logging module

Overview

python-yaml-logger is a formatter for the standard Python logging module designed to allow formatting log data as YAML. Using YAML allow for both human- and machine-readable log files, and allows developers to quickly parse and make better use of log data.

Installation

Manual installation:

$ wget http://github.com/OldhamMade/python-yaml-logger/archive/master.tar.gz -O- | tar zx
$ cd python-yaml-logger-master
$ python setup.py install

Usage

import logging
import yamlformatter

logger = logging.getLogger()
logHandler = logging.FileHandler('my.yamllog')
formatter = yamlformatter.YAMLFormatter()
logHandler.setFormatter(formatter)
logger.addHandler(logHandler)

Example output

- asctime: 2013-04-10 15:39:26,014
  created: 1365604766.014612
  levelname: INFO
  message: test message
  name: logger_name
 
File Type Py Version Uploaded on Size
python-yaml-logger-0.3.1.tar.gz (md5) Source 2014-08-14 2KB
  • Downloads (All Versions):
  • 17 downloads in the last day
  • 72 downloads in the last week
  • 420 downloads in the last month