Skip to content
forked from Logni/logni.py

python library for event logging and application states

License

Notifications You must be signed in to change notification settings

erikni/logni.py

 
 

Repository files navigation

Codacy Badge Github Releases Build Status License: GPL v3

logni.py

logni is a python library for event logging and application states

How to install?

  • git (github)
  • pip (python packages -> todo)

Install from Github

$ git clone https://github.com/erikni/logni.py.git
$ cd logni.py
$ pip install -r requirements.txt
$ python src/logni.py

Example

$ python

>>> import logni
>>> log = logni.Logni()

>>> log.mask('ALL')
>>> log.stderr(1)

$ log.log('tests %s %s', (11, 22), INFO=3)
2016/04/01 22:08:18 [15489] I3: tests 11 22 [17ed5aec] {logni.py:<module>():196}

$ log.critical('critical message')
2016/04/01 22:08:18 [15489] F4: critical message [7e995d1a] {logni.py:fatal():161}

$ log.error('error message #%s', time.time(), priority=4)
2016/04/01 22:08:18 [15489] E4: error message #1459541298.29 [58138001] {logni.py:error():164}

$ log.warn('warning message #%s', time.time(), priority=3)
2016/04/01 22:08:18 [15489] W3: warning message #1459541298.29 [91b483ab] {logni.py:warn():167}

$ log.info('info message #%s', time.time(), priority=2)
2016/04/01 22:08:18 [15489] I2: info message #1459541298.29 [eaf58c15] {logni.py:info():170}

$ log.debug('debug message #%s', time.time(), priority=1)
2016/04/01 22:08:18 [15489] D1: debug message #1459541298.29 [37e911b8] {logni.py:debug():173}

Test

test/unit

Contribution

Pull Requests are very welcome.

Licence

GNU General Public License v3.0

About

python library for event logging and application states

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 87.0%
  • Makefile 13.0%