本文整理匯總了Python中core.logger.Logger.get_logger方法的典型用法代碼示例。如果您正苦於以下問題:Python Logger.get_logger方法的具體用法?Python Logger.get_logger怎麽用?Python Logger.get_logger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core.logger.Logger
的用法示例。
在下文中一共展示了Logger.get_logger方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: parse_criteria
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import get_logger [as 別名]
def parse_criteria(cls, criteria):
result = ''
for key in criteria:
if type(criteria[key]) == dict:
if key.upper() == 'NOT':
result += ' NOT (%s) ' % cls.parse_criteria(criteria[key])
elif key.upper() in ['AND', 'OR']:
result += ' ('
#parse each value in criteria[key] and stick key in between them
innerResults = []
for innerKey in criteria[key]:
innerResults.append(cls.parse_criteria({innerKey: criteria[key][innerKey]}))
result += key.upper().join(innerResults)
result += ') '
else:
Logger.get_logger(__name__).warn('I\'m sorry, I don\'t speak idiot. Couldn\'t parse operator declaration: %s', key)
else:
if type(criteria[key]) == str:
result += ' %s = "%s" ' % (key, criteria[key])
else:
result += ' %s = %s ' % (key, criteria[key])
if result == '':
result = '1'
return result
示例2: __init__
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import get_logger [as 別名]
def __init__(self):
# logging
self.logger = Logger.get_logger(__name__)
# tvrobot core object
# self.tvrobot = TvRobot()
# static handlers
handlers = [
(r'/sms', SMSHandler),
(r'/event', EventHandler),
]
# tornado app settings
settings = dict(
debug = False,
cookie_secret = config.TVROBOT['API']['cookie_secret']
)
# init app with settings and static handlers
tornado.web.Application.__init__(self, handlers, **settings)
self.logger.info('API initialized successfully')
示例3: __init__
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import get_logger [as 別名]
def __init__(self):
self.logr = Logger.get_logger(__name__)
self._conn = None
self._conn = self.__get_conn()
示例4: __init__
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import get_logger [as 別名]
def __init__(self, save_to=None):
self.logger = Logger.get_logger(utils.get_fullname(self))
self.save_to = save_to or getattr(settings, 'SAVE_DIR')
示例5: __init__
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import get_logger [as 別名]
def __init__(self, url=None):
BaseSourceFeed.__init__(self, url)
self.logger = Logger.get_logger(utils.get_fullname(self))
self.logger.debug('Created an instance')
示例6: __init__
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import get_logger [as 別名]
def __init__(self):
self.logr = Logger.get_logger(__name__)
self._new = False
for fieldidx in self.FIELDS:
setattr(self, self.FIELDS[fieldidx], None)
示例7: search
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import get_logger [as 別名]
def search(cls, criteria = {}):
logr = Logger.get_logger(__name__)
pass