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.

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

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page