Skip to main content

使用教程

import kancylog as log

# 控制是否打印彩色日志,默认是True
# log.disablePrintColor()

# 使用默认的Logger实例
log.debug("debug log")
log.info("info log")
log.warn("warn log")
log.error("error log")
log.success("success log")
log.log("good log", "GOOD")


# 自定义Logger对象
logger = log.Logger(color=True, tag="demo", file="test_{date}.log")
logger.debug("debug log")
logger.info("info log")
logger.warn("warn log")
logger.error("error log")
logger.success("success log")
logger.log("good log", "GOOD")

1)文字效果

2021-11-27 01:17:56.316447 DEBUG 115872 <mainthread> - [log_tests.py::6] : debug log
2021-11-27 01:17:56.316447  INFO 115872 <mainthread> - [log_tests.py::7] : info log
2021-11-27 01:17:56.316447  WARN 115872 <mainthread> - [log_tests.py::8] : warn log
2021-11-27 01:17:56.316447 ERROR 115872 <mainthread> - [log_tests.py::9] : error log
2021-11-27 01:17:56.316447    OK 115872 <mainthread> - [log_tests.py::10] : success log
2021-11-27 01:17:56.316447  GOOD 115872 <mainthread> - [log_tests.py::11] : good log
2021-11-27 01:17:56.316447 DEBUG 115872 <mainthread> - [log_tests.py::16] (demo) : debug log
2021-11-27 01:17:56.316447  INFO 115872 <mainthread> - [log_tests.py::17] (demo) : info log
2021-11-27 01:17:56.316447  WARN 115872 <mainthread> - [log_tests.py::18] (demo) : warn log
2021-11-27 01:17:56.316447 ERROR 115872 <mainthread> - [log_tests.py::19] (demo) : error log
2021-11-27 01:17:56.316447    OK 115872 <mainthread> - [log_tests.py::20] (demo) : success log
2021-11-27 01:17:56.316447  GOOD 115872 <mainthread> - [log_tests.py::21] (demo) : good log

2)图片效果

img.png

Download files

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

Source Distribution

kancylog-0.0.5.tar.gz (5.7 kB view details)

Uploaded Source

Built Distributions

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

kancylog-0.0.5-py3.9.egg (7.0 kB view details)

Uploaded Egg

kancylog-0.0.5-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file kancylog-0.0.5.tar.gz.

File metadata

  • Download URL: kancylog-0.0.5.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kancylog-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9006faa7dd4847d9a6f2f41440b42674586c29dc77d5027280bbc55a859d38d6
MD5 954afcf61affb49100f8b38b93e7356a
BLAKE2b-256 1ef99994c1336f1652f716aa006470b4c76f53b0dff5a33bd8e5c4b7595f72d1

See more details on using hashes here.

File details

Details for the file kancylog-0.0.5-py3.9.egg.

File metadata

  • Download URL: kancylog-0.0.5-py3.9.egg
  • Upload date:
  • Size: 7.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kancylog-0.0.5-py3.9.egg
Algorithm Hash digest
SHA256 d1c8106dc6082e04947c003a54753cef6fd62da4c0a856a14fb2c1a1dfd0e75b
MD5 e86c334799ab6a98858dc686a11a66e4
BLAKE2b-256 b5b6ba17191b0a1f4694f70e6ade2b2f3c33cf290e93a6425691918d0991b608

See more details on using hashes here.

File details

Details for the file kancylog-0.0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: kancylog-0.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kancylog-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d5d15cb03de9759767c72ba30c5e4bf12285b22ec27bd2435bc84da3c1e9d6b6
MD5 72105276a2387327de2ae1549dac4aac
BLAKE2b-256 e35fd2b33d2fa047faa8e4314c8921ea79c93e3427284062cdf1b7c3ffebce7e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.5 This release

3 files

0.0.4

3 files

0.0.3

3 files

0.0.2

3 files

0.0.1

3 files

Supported by

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