我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用logbook.set_datetime_format()。
def get_logger(name, debug=True): logbook.set_datetime_format('local') handler = StreamHandler(sys.stdout) if debug else NullHandler() handler.push_application() return Logger(os.path.basename(name))
def get_logger(name='monkey??????????', file_log=file_stream, level=''): """ get logger Factory function """ logbook.set_datetime_format('local') ColorizedStderrHandler(bubble=False, level=level).push_thread() logbook.TimedRotatingFileHandler( os.path.join(LOG_DIR, '%s.log' % name), date_format='%Y-%m-%d-%H', bubble=True, encoding='utf-8').push_thread() return logbook.Logger(name)
def get_logger(name='jiekou', file_log=file_stream, level=''): """ get logger Factory function """ logbook.set_datetime_format('local') ColorizedStderrHandler(bubble=False, level=level).push_thread() logbook.TimedRotatingFileHandler( os.path.join(LOG_DIR, '%s.log' % name), date_format='%Y-%m-%d-%H', bubble=True, encoding='utf-8').push_thread() return logbook.Logger(name)