本文整理汇总了Python中models.Log.thread方法的典型用法代码示例。如果您正苦于以下问题:Python Log.thread方法的具体用法?Python Log.thread怎么用?Python Log.thread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Log
的用法示例。
在下文中一共展示了Log.thread方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: emit
# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import thread [as 别名]
def emit(self, record):
log = Log()
obj = getattr(record, "obj", None)
if obj:
log.obj = unicode(obj)
log.name = unicode(record.name)
log.level = unicode(record.levelname)
log.module = unicode(record.module)
log.func_name = unicode(record.funcName)
log.line_no = unicode(record.lineno)
log.thread = unicode(record.thread)
log.thread_name = unicode(record.threadName)
log.process = unicode(record.process)
log.message = unicode(record.msg)
log.args = unicode(record.args)
db.session.add(log)
db.session.commit()
示例2: emit
# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import thread [as 别名]
def emit(self, record):
log = Log()
obj = getattr(record, "obj", None)
if obj:
log.obj = repr(obj)
log.name = record.name
log.level = record.levelname
log.module = record.module
log.func_name = record.funcName
log.line_no = record.lineno
log.thread = record.thread
log.thread_name = record.threadName
log.process = record.process
log.message = record.msg
log.args = str(record.args)
db.session.add(log)
db.session.commit()