当前位置: 首页>>代码示例>>Python>>正文


Python Log.message方法代码示例

本文整理汇总了Python中models.Log.message方法的典型用法代码示例。如果您正苦于以下问题:Python Log.message方法的具体用法?Python Log.message怎么用?Python Log.message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Log的用法示例。


在下文中一共展示了Log.message方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _to_logs

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import message [as 别名]
 def _to_logs(self, hits):
     logs = []
     for hit in hits:
         log = Log()
         log.id = hit.meta.id
         log.filename = hit.filename
         log.level = hit.level
         log.message = hit.message
         log.created_at = utils.to_datetime(hit.created_at, '%Y-%m-%d')
         logs.append(log)
     return logs
开发者ID:gustavohenrique,项目名称:elasticlog,代码行数:13,代码来源:elasticlog.py

示例2: log

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import message [as 别名]
    def log(self, msg, level=logging.INFO, append_to_last=False, fin=False):

        if append_to_last:
            log = Log.objects.filter(configuration=self.configuration).order_by('id').last()
            log.message += msg
        else:
            log = Log()
            log.configuration = self.configuration
            log.message = msg

        log.finished = fin
        log.save()
开发者ID:ivansek-magistrska,项目名称:webapp,代码行数:14,代码来源:views.py

示例3: emit

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import message [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()
开发者ID:PuZheng,项目名称:Flask-DataBrowser,代码行数:19,代码来源:basemain.py

示例4: emit

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import message [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()
开发者ID:xiechao06,项目名称:Flask-DataBrowser,代码行数:19,代码来源:basemain.py


注:本文中的models.Log.message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。