当前位置: 首页>>代码示例>>Python>>正文


Python logging_helper.config_logger函数代码示例

本文整理汇总了Python中utils.logging_helper.config_logger函数的典型用法代码示例。如果您正苦于以下问题:Python config_logger函数的具体用法?Python config_logger怎么用?Python config_logger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了config_logger函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: config_logger

import sys

# Setup the Python Path as we may be running this via ssh
base_path = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(base_path, '..')))
sys.path.append(os.path.abspath(os.path.join(base_path, '../../../../boinc/py')))

import argparse
from utils.logging_helper import config_logger, add_file_handler_to_root
from utils.s3_helper import S3Helper
from archive.archive_boinc_stats_mod import process_ami, process_boinc
from utils.ec2_helper import EC2Helper
from utils.name_builder import get_archive_bucket, get_log_archive_key, get_ami_log_file
from utils.sanity_checks import pass_sanity_checks

LOG = config_logger(__name__)

parser = argparse.ArgumentParser('Archive BOINC statistics to S3')
parser.add_argument('option', choices=['boinc','ami'], help='are we running on the BOINC server or the AMI server')
args = vars(parser.parse_args())

if args['option'] == 'boinc':
    LOG.info('PYTHONPATH = {0}'.format(sys.path))
    # We're running from the BOINC server
    process_boinc()
else:
    # We're running from a specially created AMI
    filename, full_filename = get_ami_log_file('archive_boinc_stats')
    add_file_handler_to_root(full_filename)
    LOG.info('PYTHONPATH = {0}'.format(sys.path))
    LOG.info('About to perform sanity checks')
开发者ID:sesef,项目名称:boinc-magphys,代码行数:31,代码来源:archive_boinc_stats.py


注:本文中的utils.logging_helper.config_logger函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。