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


Python Logging.setupLogging方法代码示例

本文整理汇总了Python中Logging.setupLogging方法的典型用法代码示例。如果您正苦于以下问题:Python Logging.setupLogging方法的具体用法?Python Logging.setupLogging怎么用?Python Logging.setupLogging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logging的用法示例。


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

示例1: str

# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import setupLogging [as 别名]
    parser = argparse.ArgumentParser(description=my_description)

    parser.add_argument('--name', '-n', help='DB in CouchDB for output',
                        type=str, required=True)
    parser.add_argument('--type', '-t', help='event type', type=str,
                        required=True)
    parser.add_argument('--logfileless', action='store_true',
                        help='this will disable writing out a log file')

    parser.add_argument('--run', help='run number',
                        type=int, required=True)

    Logging.addLogLevelOptionToArgs(parser)  # adds --log_level
    args = parser.parse_args()

    Logging.setupLogging(args.log_level, args.name)
    log = logging.getLogger('root').getChild(sys.argv[0].split('.')[0])
    log.debug('Commandline args: %s', str(args))

    Configuration.name = args.name
    Configuration.run = args.run

    config = Configuration.CouchConfiguration()
    db = config.getCurrentDB()

    # Note the key below: "[document.number_run, document.number_event]" which
    # is important because CouchDB will sort by this.  It's part of our ROOT
    # file specification that it be sorted like this.
    map_fun = """
function(doc) {
  if (doc.type == '%s' && doc.number_run == %d) {
开发者ID:rbayes,项目名称:gnomon,代码行数:33,代码来源:couch_to_ntuple.py


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