Skip to main content

Just a simple script to create a logger object for logging to console

Project description

hns_console_logging

Just a simple script to create a logger object for logging to console. It is intended to be used with services running as docker container. By using the logging facility in docker container, you don't need to write logs to the file, you can use the logs written to file by docker daemon.

Installation

pip install hns-console-logging

Usage

import hns_console_logging
logger = hns_console_logging.get_logger('test_module')
logger.info('Info msg')

You can change the default log format and log level.
Default log format: %(asctime)s %(levelname)s %(name)s %(funcName)s [PID:%(process)d TID:%(thread)d] %(message)s
Default log level: INFO
Default formatter class: logging.Formatter

To change log format, please refer: https://docs.python.org/3/library/logging.html#logrecord-attributes

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

hns_console_logging-20.5.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

hns_console_logging-20.5-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file hns_console_logging-20.5.tar.gz.

File metadata

  • Download URL: hns_console_logging-20.5.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for hns_console_logging-20.5.tar.gz
Algorithm Hash digest
SHA256 acd48cd6c86427b3aa3075a4af047b1064cce14d15e5742b18fa764ad3c17dc4
MD5 acbe28834bfa9de109292d2af30ad758
BLAKE2b-256 9099dfb723ec5e60c4a6caa8a0bbe694d6e992632b09806824289a9af7165a73

See more details on using hashes here.

File details

Details for the file hns_console_logging-20.5-py3-none-any.whl.

File metadata

  • Download URL: hns_console_logging-20.5-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for hns_console_logging-20.5-py3-none-any.whl
Algorithm Hash digest
SHA256 769fc2ed9e5eb39a83643393f794aeb02419e57792d03510f7a3e68ea87ea5bf
MD5 373802b355bb1943d7b9010ac17ed189
BLAKE2b-256 247b1ca976fbc64754fda18ba271f2888ddb00fb281ffacc0596a4994a658953

See more details on using hashes here.

Supported by

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