actually remove all logger() occurrences

This commit is contained in:
urlbot
2015-06-21 01:31:55 +02:00
parent 32e2d15581
commit 3f6c478586
3 changed files with 6 additions and 8 deletions

View File

@@ -2,13 +2,11 @@
import time, sys import time, sys
def _logger(a, b):
sys.stderr.write('logger: %s::%s\n' %(a, b))
try: try:
logger log
except NameError: except NameError:
logger = _logger import logging
log = logging.getLogger()
if '__main__' == __name__: if '__main__' == __name__:
print('''this is a config file, which is not meant to be executed''') print('''this is a config file, which is not meant to be executed''')
@@ -58,7 +56,7 @@ config = {
def conf(val): def conf(val):
if val in list(config.keys()): if val in list(config.keys()):
return config[val] return config[val]
logger('warn', 'conf(): unknown key ' + str(val)) log.warn('conf(): unknown key ' + str(val))
return None return None
def set_conf(key, val): def set_conf(key, val):

View File

@@ -799,7 +799,7 @@ def data_parse_commands(msg_obj):
if debug_enabled(): if debug_enabled():
def _send_reply(a, msg_obj): def _send_reply(a, msg_obj):
logger('send_reply[%s]' % msg_obj, a) log.info('send_reply[%s]' % msg_obj, a)
def _conf(ignored): def _conf(ignored):
return 'bot' return 'bot'

View File

@@ -61,7 +61,7 @@ def extract_title(url):
if html_text: if html_text:
charset = '' charset = ''
if 'content-type' in headers: if 'content-type' in headers:
logger('debug', 'content-type: ' + headers['content-type']) log.debug('content-type: ' + headers['content-type'])
if 'text/' != headers['content-type'][:len('text/')]: if 'text/' != headers['content-type'][:len('text/')]:
return (1, headers['content-type']) return (1, headers['content-type'])