Skip to main content

SciLogger - Python Logging for Science

Project description

SciLogger - Python Logging for Science

Summary

SciLogger is a Python Logging module:

  • Specially targeted for scientific applications.
  • Use a global timer to measure the elapsed time.
  • Provide a class for timing code blocks.
  • Definition of custom indentation levels.
  • Definition of colors for the logging levels.

SciLogger is using a global INI configuration file:

  • First, the default configuration is loaded (scilogger/scilogger.ini).
  • Afterward, a custom file can be loaded with an environment variable (SCILOGGER)

SciLogger is written in Python without any external dependencies.

Warning

  • This logging module is based on the Python logging module.
  • The philosophy of this logging module is slightly different.
  • Mixing both modules can create strange/incorrect behaviors.

Example

An example is located in the example folder of the repository:

  • run_logger.py contains an example file for the logger
  • configlogger.ini contains a custom configuration file
# Set the configuration file.
export SCILOGGER="configlocal.ini"

# Run the Python script.
python run_logger.py

Project Links

Author

Copyright

(c) 2023 - Thomas Guillod

BSD 2-Clause "Simplified" 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

scilogger-1.1.0.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

scilogger-1.1.0-py3-none-any.whl (8.9 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