MobioLogging
Project description
m-formatter-logging là thư viện python để write log cho các module BackEnd-Mobio
Version:
Phiên bản hiện tại 1.0.2
Cài đặt:
pip3 install m-formatter-logging
Sử dụng:
- Example:
if __name__ == '__main__':
def test():
MobioLogging().info('app_test_lib_logging::test():info', sensitive=True, extra={"key1": "value1"})
try:
a = 1 / 0
MobioLogging().info('__init__::test():a: %s' % a)
except Exception as ex1:
MobioLogging().error('app_test_lib_logging::test():error: %s' % ex1, sensitive=True)
MobioLogging().debug('app_test_lib_logging::test():debug')
MobioLogging().warning('app_test_lib_logging::test():warning', sensitive=False)
test()
- Sử dụng file custom config:
config_file_path = 'path/to/config/file'
MobioLogging().file_config(self, config_file_path)
- Sử dụng custom filter:
class CustomizeFilterRecords():
def filter(self, record):
if record.key1 == 'value1':
return False # no log
return True
MobioLogging().logger.addFilter(CustomizeFilterRecords())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for m-formatter-logging-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30453d86a831914aa7be3a1f0fee00bc2d8dd6bfd2ff0a632e0a341362d8c84f |
|
MD5 | a5a2786de8a08a6c05c6b37b3818aad4 |
|
BLAKE2b-256 | 20cdc43ed6281207996ded970dbc5df545920b9b8f09ff05dbee8f3bbe443d56 |