本文整理汇总了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) {