Skip to main content

A simple file logger configuration for Python

Project description

ems-simple-logger-config

This is a simple (file) logger configuration for Python.

Installation:

pip install ems-simple-logger-config

On app level: Initialize logger with default values to get a common console output:

import logger

log = logger.setup_logger()
log.info('Some text')

On app level: Alternatively initialize logger with some configuration. If file_name is added a log file will be created.

import logger

log = logger.setup_logger(logger_name = 'SomeLoggerName', log_level = logging.DEBUG, file_name = 'log.txt')
log.info('Some text')

On module level get the logger by

log = logger.get_logger(__name__)
log.info('Some text')

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

ems-simple-logger-config-0.0.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

ems_simple_logger_config-0.0.2-py3-none-any.whl (3.3 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