Skip to main content

glogcenter 的 python 版客户端

Project description

日志中心的 python 客户端

使用python语言的项目,提供工具包,开箱即用

# 支持以下环境变量配置
export GLC_ENABLE=true # 默认false,要发送日志中心必须配置为true
export GLC_ENABLE_CONSOLE_LOG=true # 默认true,控制台不打印时配置为false
export GLC_API_URL='http://127.0.0.1:8080/glc/v1/log/add' # 未配置时将取消发送
export GLC_API_KEY='X-GLC-AUTH:glogcenter' # 这是默认值,按需修改
export GLC_SYSTEM=default  # 默认default,按需修改
export GLC_LOG_LEVEL=debug # 日志级别(debug/info/warn/error),默认debug
export GLC_TRACE_ID=12345  # 默认空
# 安装
pip install glogcenter

# 使用
from glogcenter import glc

glc.debug("这是Debug级别日志")
glc.info("这是Info级别日志", "多个参数", "会被拼接")
gd = glc.GlcData()
gd.user = 'abcd'
glc.warn("这里的GlcData类型参数都不会打印", "gd只起传值作用", gd)
glc.error("gd参数顺序无关", gd, "用法如同log库,但对GlcData做了特殊的判断处理")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glogcenter-0.17.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glogcenter-0.17.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file glogcenter-0.17.1.tar.gz.

File metadata

  • Download URL: glogcenter-0.17.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for glogcenter-0.17.1.tar.gz
Algorithm Hash digest
SHA256 fa0af51e84f8edd3ed12f95d75e74521ffec7ef4de1eda1d97043efe7bbd4387
MD5 dd4f6e4981077064a67828aeba2b6a1d
BLAKE2b-256 7201b378f5a89661ff693c8c1f0e5446af6f656f39b7dab3a294f6b52e5390ff

See more details on using hashes here.

File details

Details for the file glogcenter-0.17.1-py3-none-any.whl.

File metadata

  • Download URL: glogcenter-0.17.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for glogcenter-0.17.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f8fcd0b4944509b8599d7af998dae4d70291f908fdac480f5297bb9156df39c
MD5 e2f877f0a42c5975f6fe7deb80a1377f
BLAKE2b-256 f060dbdd53b01e319122ee123fa47b0d620671b765f45437370644046ecff016

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page