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


Release history Release notifications

Download files

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

Files for hns-console-logging, version 19.11
Filename, size File type Python version Upload date Hashes
Filename, size hns_console_logging-19.11-py3-none-any.whl (3.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size hns_console_logging-19.11.tar.gz (1.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page