Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oldhammade/python-yaml-logger
YAML formatter for the standard Python logging module
https://github.com/oldhammade/python-yaml-logger
Last synced: about 6 hours ago
JSON representation
YAML formatter for the standard Python logging module
- Host: GitHub
- URL: https://github.com/oldhammade/python-yaml-logger
- Owner: OldhamMade
- License: mit
- Created: 2013-04-10T10:52:10.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-14T13:54:45.000Z (over 10 years ago)
- Last Synced: 2024-11-07T15:17:49.212Z (8 days ago)
- Language: Python
- Size: 197 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
python-yaml-logger
==================|travis_status|_
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 installUsage
-----::
import logging
import yamlformatterlogger = 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.. _YAML: http://en.wikipedia.org/wiki/YAML
.. |travis_status| image:: https://secure.travis-ci.org/OldhamMade/python-yaml-logger.png
.. _travis_status: https://secure.travis-ci.org/OldhamMade/python-yaml-logger