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 %(name)s %(funcName)s[PID:%(process)d TID:%(thread)d] %(levelname)s %(message)s
Default log level: INFO

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-19.11.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

hns_console_logging-19.11-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

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