lib-not-dr/example/logger/logger.py

30 lines
858 B
Python
Raw Normal View History

2023-11-06 00:31:03 +08:00
# -------------------------------
# Difficult Rocket
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
from lib_not_dr.logger.logger import Logger
if __name__ == '__main__':
logger = Logger.get_logger_by_name('test')
2023-11-06 00:34:06 +08:00
logger.global_level = 0
2023-11-06 00:31:03 +08:00
logger.info('Hello World!')
logger.fine('Hello World!')
logger.debug('Hello World!')
2023-11-07 01:03:07 +08:00
logger.trace('Hello tracing!')
logger.warn('warnnnnnnn')
2023-11-06 00:31:03 +08:00
logger.error('Hello World!')
2023-11-07 01:03:07 +08:00
logger.fatal('good bye world')
logger.info('this message if from tag', tag='test')
logger.debug('this debug log if from admin', tag='admin')
logger.debug('and this message ends with none', end=' ')
logger.trace('so this message will be in the same line', tag='same line!')
2023-11-07 01:03:07 +08:00
logger.info('so just info some stuff')