46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
"""
|
|
@file config.py
|
|
@date 2009-02-15
|
|
Contributors can be viewed at:
|
|
http://svn.secondlife.com/svn/linden/projects/2008/pyogp/CONTRIBUTORS.txt
|
|
|
|
$LicenseInfo:firstyear=2008&license=apachev2$
|
|
|
|
Copyright 2008, Linden Research, Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License").
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
or in
|
|
http://svn.secondlife.com/svn/linden/projects/2008/pyogp/LICENSE.txt
|
|
|
|
$/LicenseInfo$
|
|
"""
|
|
|
|
# std lib
|
|
import logging
|
|
|
|
#pyogp
|
|
from pyogp.lib.base.settings import Settings
|
|
|
|
settings = Settings()
|
|
debug = settings.ENABLE_LOGGING_IN_TESTS
|
|
|
|
#setup logging
|
|
|
|
if debug:
|
|
|
|
console = logging.StreamHandler()
|
|
console.setLevel(logging.DEBUG) # seems to be a no op, set it for the logger
|
|
formatter = logging.Formatter('%(asctime)-30s%(name)-15s: %(levelname)-8s %(message)s')
|
|
console.setFormatter(formatter)
|
|
logging.getLogger('').addHandler(console)
|
|
|
|
# setting the level for the handler above seems to be a no-op
|
|
# it needs to be set for the logger, here the root logger
|
|
# otherwise it is NOTSET(=0) which means to log nothing.
|
|
logging.getLogger('').setLevel(logging.DEBUG)
|
|
logger = logging.getLogger('pyogp.lib.base.tests.helpers')
|
|
|
|
logger.debug('setting debug to True') |