Simple straight logging your Python code
Alog
Your goto Python logging without panic on context swtich.
Warning: No more logger = logging.getLogger(__name__)
in your every file.
>>> import alog
>>> alog.info("Hi.")
2016-12-18 20:44:30 INFO Hi.
>>> def test():
... alog.info("Test 1")
... alog.error("Test 2")
...
>>> test()
2016-12-18 20:45:19 INFO Test 1
2016-12-18 20:45:19 ERROR Test 2
>>> alog.set_level("ERROR")
>>> test()
2016-12-18 20:45:41 ERROR Test 2
If you’re new to logging, see Why should you use logging instead of print.
Installation
pip install alog
Features
-
Instant logging with expected defaults.
You can do logging instantly by reading a small piece of README. Alog comes with useful defaults:
-
A default logger.
-
Logging level:
logging.INFO
-
Logging format:
-