Skip to main content

Dead simple Python logger. Redirects stdout to a file while maintaining console printing.

Project description

logger_util

Dead simple Python logger.

This library redirects the stdout and stderr to a Log object that saves the text printed to the console to a file. The file is auto-generated and is named based on the number of files in the log directory. Adding simple LogLevel attributes at the start of your printed debug text allows the log to be parsed and separately into severity levels.

Install using: pip install logger-util==0.2

from logger_util import CreateLogger, log_startup

if __name__ == "__main__":
    CreateLogger()
    log_startup()
    print("INFO: This is a test message.")

Calling CreateLogger will instantiate all the necessary variables, files, and directories. Nothing more needs to be done other than writing to the console.

This library is licensed under the MIT license.

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

logger_util-0.3.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

logger_util-0.3.0-py3-none-any.whl (4.2 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