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
Metadata
Release files for scilogger 1.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scilogger-1.2.5.tar.gz | 12.4 kB | Without provenance | Details for scilogger-1.2.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scilogger-1.2.5-py3-none-any.whl | Python 3 | none | any | Details for scilogger-1.2.5-py3-none-any.whl |
Total release size: 22.1 kB
Release files / scilogger-1.2.5.tar.gz
| Download URL | scilogger-1.2.5.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bfe61c0bd2bcb1101f5540b4782a5defa6ebc1d09262d6df52a9a6a7e6aca29
|
|
BLAKE2b-256 checksum How to use checksums |
8f9da0bef0274ef8739583096486652d8c4640c65345f4c2dae47a014a3a19fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / scilogger-1.2.5-py3-none-any.whl
| Download URL | scilogger-1.2.5-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76ea3c52121da2961631daf78db6ff18ced940273e57f2db2a749a54ff4309d1
|
|
BLAKE2b-256 checksum How to use checksums |
013495155ccc4caf488a7e7354fbfef0ccc02b9735deb283b3eaffd55456c95f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Security for scilogger 1.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.