这里是你的项目描述

frame_logging的Python项目详细描述


https://badge.fury.io/py/frame_logging.svghttps://travis-ci.org/ItsfBisounours/frame_logging.svg?branch=masterhttps://codecov.io/gh/ItsfBisounours/frame_logging/branch/master/graph/badge.svg

此处是您的项目说明

文档

完整的文档位于https://frame_logging.readthedocs.io

快速启动

  1. 安装帧日志:

    pip install frame_logging
    
  2. 将其添加到已安装的应用程序中

INSTALLED_APPS=(...'frame_logging.apps.FrameLoggingConfig',...)
  1. 创建一个类以格式化额外的日志记录Kwargs
#classFrameFormatterExample(FrameFormatter):# format methods@classmethoddefget_format_behaviour(cls):returnOrderedDict([('customer_id',cls.format_customer_id),])@classmethoddefformat_customer_id(cls,customer_id):return"customer_id={}".format(customer_id)# then if you need to, you can add new method to transform extra kwargs# transform methods@classmethoddefget_transform_kwargs_methods(cls):return{'order':cls.transform_order,}@classmethoddeftransform_order(cls,order,**kwargs):kwargs['customer_id']=order.customer['id']returnkwargs
  1. 在settings.py中配置frame loggin
# mandatory, if you do not priovide a formatter the app will crashFRAME_FORMATTER=FrameFormatterExample()# optionnal, default = ' - 'FRAME_SEPARATOR='+'
  1. 使用:
importframe_logging.logaslogclassOrder(object):def__init__(self):self.customer={'id':1}log.info('Renewed contract %s','test',order=order)# 'Renewed contract test - customer_id=1'))

功能

  • 待办事项

运行测试

代码真的有用吗?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

学分

用于呈现此包的工具:

历史记录

0.1.0(2017-10-26)

  • pypi上的第一个版本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将Map<String,String>传递给需要Map<String,Object>   java在循环中使用字符串而不是StringBuilder是否会造成内存损失?   jnlp如何更新java控制台JRE?   java更改、修改和重新打包CXFAPI源文件   JavaFXJava应用程序在Fedora上运行一段时间后关闭   使用来自不同类的方法的java   java如何通过ant脚本在linux中使用subst?   java在使用camunda modeler进行base64编码/解码时出错   获取java。netbeans、weblogic和fastswap设置为true时的lang.NoSuchMethodError   java如何提高FinalizerThread在GC中收集对象的优先级   java检测具有相同根的单词   netbeans crud应用程序中的java错误