数据狗日志记录处理程序和实用程序
ddlogs的Python项目详细描述
ddlogs
=
[![版本](https://img.shields.io/pypi/v/ddlogs.svg)(http://pypi.shieldeshields.io/pypi/v/ddlogs.svg)(https://pypi.pypypypypi.org/pypi/pypi/ddlogs)
pip安装ddlog
``
#用法
``python
import logging
import ddlogs
logger=logging.getlogger('test')
h=ddlogs.datadoglogshandler(
api-key='your-datadog-api-key',默认值:os.environ.get('dd-api-key')
source category='samplecategory',默认值:“ddlogs”
source='samplesource,#默认值:“python”
service='sampleservice',默认值:logger.name
host='localhost')默认值:gethostname()
h.setformatter(ddlogs.dictformatter())
logger.addhandler(h)
logger.error({foo':'bar})
````
output
![截图](https://raw.githubusercontent.com/marcy terui/ddlogs/master/images/screenshot.png)
----
-源代码托管在[github](https://github.com/marcy terui/ddlogs)
-报告问题/问题/功能请求关于[github
问题](https://github.com/marcy terui/ddlogs/issues)
非常欢迎您的要求!确保您的补丁经过了良好的测试。
理想情况下,为您所做的每个单独更改创建一个主题分支。对于
示例:
1。分拆回购
2。创建功能分支(`git checkout-b my new feature`)
3。提交更改(`git commit-am'添加了一些功能'`)
4。推到分支(`git push origin my new feature`)
5。创建新的请求
作者
----
由[Masashi Terui]创建和维护(https://github.com/marcy-terui)(lt;marcy9114@gmail.com>;)
许可证
----
=
[![版本](https://img.shields.io/pypi/v/ddlogs.svg)(http://pypi.shieldeshields.io/pypi/v/ddlogs.svg)(https://pypi.pypypypypi.org/pypi/pypi/ddlogs)
pip安装ddlog
``
#用法
``python
import logging
import ddlogs
logger=logging.getlogger('test')
h=ddlogs.datadoglogshandler(
api-key='your-datadog-api-key',默认值:os.environ.get('dd-api-key')
source category='samplecategory',默认值:“ddlogs”
source='samplesource,#默认值:“python”
service='sampleservice',默认值:logger.name
host='localhost')默认值:gethostname()
h.setformatter(ddlogs.dictformatter())
logger.addhandler(h)
logger.error({foo':'bar})
````
output
![截图](https://raw.githubusercontent.com/marcy terui/ddlogs/master/images/screenshot.png)
----
-源代码托管在[github](https://github.com/marcy terui/ddlogs)
-报告问题/问题/功能请求关于[github
问题](https://github.com/marcy terui/ddlogs/issues)
非常欢迎您的要求!确保您的补丁经过了良好的测试。
理想情况下,为您所做的每个单独更改创建一个主题分支。对于
示例:
1。分拆回购
2。创建功能分支(`git checkout-b my new feature`)
3。提交更改(`git commit-am'添加了一些功能'`)
4。推到分支(`git push origin my new feature`)
5。创建新的请求
作者
----
由[Masashi Terui]创建和维护(https://github.com/marcy-terui)(lt;marcy9114@gmail.com>;)
许可证
----