Skip to main content

Yet another logging package for Python

Project description

Inspired by the original logging package from Python.

About this package

Console logger is a simple logging package for Python. The main feature of the package is an ability to log messages in different ways. Log records can be output as follows:

  • console output;
  • output to a file;
  • both console and file output.

Supported features

  • easy access to logger at module level
  • logging record can be emitted with specified keywords without logger changing
  • colored output in console
  • rotating text files when the current file reaches a certain size

Usage

How to install

pip install console_logger

How to use

  1. Import the package.

    import console_logger
    
  2. Create a logger instance...

    my_logger = console_logger.Logger()
    
  3. ... and use it for logging messages.

    my_logger.info("My message with severity 'INFO'.")
    

Examples

>>> import console_logger
>>> my_logger = console_logger.Logger()
>>> my_logger.info('Here we go!')
08.09.22 00:01:55.123 [  INFO  ] Here we go!
>>> my_logger.debug('This message will not be displayed')
>>> my_logger.error('Oops!')
08.09.22 00:01:57.456 [ ERROR  ] Oops!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

console_logger-0.0.9-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file console_logger-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: console_logger-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for console_logger-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 0040fa68ee81306ad2bd9f6262c120ada40072c73686510fe9c5a9528f649c86
MD5 4c37f54090a9a3fe82ee985d21dbe59b
BLAKE2b-256 aafdc1a80b82b4e6d6410ca4cc8e2b3bdf3893825f4144dbed7da2275f58211f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page