SciLogger - Logging for Scientific Applications
Project description
SciLogger - Logging for Scientific Applications
- Repository: github.com/otvam/scilogger
- PyPi: pypi.org/project/scilogger
- Conda: anaconda.org/conda-forge/scilogger
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. SciLogger is respecting semantic versioning (starting from version 1.2).
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.pycontains an example file for the loggerconfiglogger.inicontains a custom configuration file
# Set the configuration file.
export SCILOGGER="configlocal.ini"
# Run the Python script.
python run_logger.py
00:00:00.00 : main : debug : debug level log
00:00:00.10 : main : info : info level log
00:00:00.20 : main : error : error level log
00:00:00.20 : main : info : example for the timed blocks : enter : 00:00:00.00
00:00:00.20 : main : info : info level log
00:00:00.30 : main : info : info level log
00:00:00.30 : main : info : example for the timed blocks : exit : 00:00:00.10
00:00:00.30 : main : info : example for the indented blocks : enter
00:00:00.30 : main : info : info level log
00:00:00.40 : main : info : info level log
00:00:00.40 : main : info : example for the indented blocks : exit
00:00:00.40 : main : error : exception : builtins / ValueError
00:00:00.40 : main : error : Traceback (most recent call last):
00:00:00.40 : main : error : File "run_logger.py", line 44, in <module>
00:00:00.40 : main : error : raise ValueError("example for the exceptions")
00:00:00.40 : main : error : ValueError: example for the exceptions
00:00:00.41 : mod_a : info : module_a
00:00:00.41 : mod_a : debug : debug level log
00:00:00.41 : mod_a : info : info level log
00:00:00.41 : mod_a : error : error level log
00:00:00.41 : mod_b : info : module_b
00:00:00.41 : mod_b : debug : debug level log
00:00:00.41 : mod_b : info : info level log
00:00:00.41 : mod_b : error : error level log
00:00:00.41 : main : info : timing data
00:00:00.41 : main : info : date = 2025-01-10T18:00:10Z
00:00:00.41 : main : info : duration = 00:00:00.41
00:00:00.41 : main : info : seconds = 0.409
Project Links
- Repository: https://github.com/otvam/scilogger
- Releases: https://github.com/otvam/scilogger/releases
- Tags: https://github.com/otvam/scilogger/tags
- Issues: https://github.com/otvam/scilogger/issues
- PyPi: https://pypi.org/project/scilogger
- Conda: https://anaconda.org/conda-forge/scilogger
Author
- Thomas Guillod
- Email: guillod@otvam.ch
- Website: https://otvam.ch
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scilogger-1.2.4.tar.gz.
File metadata
- Download URL: scilogger-1.2.4.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2882e339051431161e6821b722a4de987bf3c7797cffc20e7508ac26d57a6b0
|
|
| MD5 |
5c152d40428cff9c1b8581f54cfa664e
|
|
| BLAKE2b-256 |
77a4b91b2ab51e9a1e3ec8f9bfb9bdaa69b944c5a2704eeb2665b678bcf57615
|
File details
Details for the file scilogger-1.2.4-py3-none-any.whl.
File metadata
- Download URL: scilogger-1.2.4-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eda2bdc3e3cd4514f0e74ec0aa01f23c69da3a9c2652c6d1d3ae3f3fae2a7332
|
|
| MD5 |
63d441230896acc07327b86859424c9e
|
|
| BLAKE2b-256 |
a264f5a091e98033916e2a94fa671278551ffc49673f954fc843134c1e5e6f28
|