Browse Source

py-i2phosts-checker: configure logger using get_logger()

pull/1/head
Hidden Z 14 years ago
parent
commit
59254857ad
  1. 13
      py-i2phosts-checker

13
py-i2phosts-checker

@ -37,15 +37,16 @@ else:
sys.path.insert(1, DJANGO_PROJECT_PATH) sys.path.insert(1, DJANGO_PROJECT_PATH)
os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE
from web.postkey.models import i2phost from web.postkey.models import i2phost
from web.lib.utils import get_logger
# configure logger # configure logger
log = logging.getLogger(sys.argv[0]) if args.debug == True:
handler = logging.StreamHandler() log_level = 'debug'
log.addHandler(handler) log_file = None
if args.debug:
log.setLevel(logging.DEBUG)
else: else:
log.setLevel(logging.INFO) log_level = config['log_level']
log_file = config['log_file']
log = get_logger(log_level=log_level)
all_hosts = i2phost.objects.all() all_hosts = i2phost.objects.all()

Loading…
Cancel
Save