mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
actually remove all logger() occurrences
This commit is contained in:
@@ -2,13 +2,11 @@
|
||||
|
||||
import time, sys
|
||||
|
||||
def _logger(a, b):
|
||||
sys.stderr.write('logger: %s::%s\n' %(a, b))
|
||||
|
||||
try:
|
||||
logger
|
||||
log
|
||||
except NameError:
|
||||
logger = _logger
|
||||
import logging
|
||||
log = logging.getLogger()
|
||||
|
||||
if '__main__' == __name__:
|
||||
print('''this is a config file, which is not meant to be executed''')
|
||||
@@ -58,7 +56,7 @@ config = {
|
||||
def conf(val):
|
||||
if val in list(config.keys()):
|
||||
return config[val]
|
||||
logger('warn', 'conf(): unknown key ' + str(val))
|
||||
log.warn('conf(): unknown key ' + str(val))
|
||||
return None
|
||||
|
||||
def set_conf(key, val):
|
||||
|
||||
@@ -799,7 +799,7 @@ def data_parse_commands(msg_obj):
|
||||
|
||||
if debug_enabled():
|
||||
def _send_reply(a, msg_obj):
|
||||
logger('send_reply[%s]' % msg_obj, a)
|
||||
log.info('send_reply[%s]' % msg_obj, a)
|
||||
|
||||
def _conf(ignored):
|
||||
return 'bot'
|
||||
|
||||
@@ -61,7 +61,7 @@ def extract_title(url):
|
||||
if html_text:
|
||||
charset = ''
|
||||
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/')]:
|
||||
return (1, headers['content-type'])
|
||||
|
||||
Reference in New Issue
Block a user