.d88b. d888888b db dD db .d88b. d888b
.8P Y8. `88' 88 ,8P' 88 .8P Y8. 88' Y8b
88 88 88 88,8P 88 88 88 88
88 88 88 88`8b 88 88 88 88 ooo
`8P d8' .88. 88 `88. 88booo. `8b d8' 88. ~8~
`Y88'Y8 Y888888P YP YD Y88888P `Y88P' Y888P
A simplified version of Python’s logging module. Debugging levels, log formatting and log output are preconfigured. Grip and rip.
Inspired by the logging shortcuts in everyblock_code.
Django is not required, but it adds some functionality. By default, messages at or above logging module’s “debug” level are dumped into a local file.
That is unless Django’s DEBUG setting is set to True, when messages are also broadcast through stdout.
01. Download the module
pip install latimes-qiklog
02. If you want to integrate with Django, add the following variable to settings.py
LOG_DIRECTORY = './whatever/logs/'
01. Fire it up
>> from qiklog import QikLog
>> logger = QikLog('latimes.whatever')
02. Make it sing
>> logger.log.warn('WARN')
>> logger.log.info('INFO')
>> logger.log.debug('DEBUG')
03. Watch the logs pour in
#If Django's DEBUG is True
$ tail -f ./whatever/logs/latimes.whatever
#If Django's DEBUG is False, or you've passed force_debug_mode=False into QikLog, it'll fly through stdout.
This code is under the MIT license. Do with it what you will.