A Logging library for Python.
Project description
GamuLogger
📚 Table of Contents
🔨 Installation
The package is available in the assets of the latest release on pypi.
You can install it with pip:
pip install gamuLogger
💡 Usage
- First you need to import the package:
from gamuLogger import trace, debug, info, warning, error, fatal, Logger, Levels
note: you can also only import the members you need instead of importing all of them.
- Then you can use the functions like this:
info('This is an info message') warning('This is a warning message') error('This is an error message')
You may note that the logging function are also available as static methods in the
Loggerclass. This allow you to have them encapsulated in a class and use them in a more object oriented way:from gamuLogger import Logger Logger.info('This is an info message') Logger.warning('This is a warning message') Logger.error('This is an error message')
⚙️ Configuration
1. Basic Configuration
You can configure the logger using methods of the Logger class. Here is an example of how you can do it:
from gamuLogger import Logger, Levels
# default target is the standard output, name is 'stdout'
Logger.set_level("stdout", Levels.INFO); # this mean yhat all logs with level higher than INFO will be ignored
Logger.set_module('my-module'); # set the module name for this file to 'my-module' (this will be displayed in the log message) (by default, no module name is set)
Logger.add_target("data.log", Levels.DEBUG) # add a new target to the logger (this will log all messages with level higher than DEBUG to the file 'data.log')
Please note that the logger can be used without any manual configuration. The default configuration is:
- target: terminal
- level:
INFO- module name:
None
Note that the module name is set only for the current file. If you want to set the module name for all files, you need to set it in each file.
📁 Examples
you can find examples in the example directory.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 gamulogger-3.2.6.tar.gz.
File metadata
- Download URL: gamulogger-3.2.6.tar.gz
- Upload date:
- Size: 34.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56585365b25bde23ff81a10ef70bf5e851bfa282a590ba5bc4241d9ec9c10189
|
|
| MD5 |
8a4a0cee4bd2a6863677903fc5ee43b3
|
|
| BLAKE2b-256 |
7cf6ea650437f0d2fa24bb12b1ae2005713dd5575b4cb40b2c7cf13f436245ed
|
Provenance
The following attestation bundles were made for gamulogger-3.2.6.tar.gz:
Publisher:
OnRelease.yml on AntoineBuirey/gamuLogger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gamulogger-3.2.6.tar.gz -
Subject digest:
56585365b25bde23ff81a10ef70bf5e851bfa282a590ba5bc4241d9ec9c10189 - Sigstore transparency entry: 754794977
- Sigstore integration time:
-
Permalink:
AntoineBuirey/gamuLogger@0f881c8de4f4e5158aa3a97ab99898b328d497b2 -
Branch / Tag:
refs/tags/3.2.6 - Owner: https://github.com/AntoineBuirey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
OnRelease.yml@0f881c8de4f4e5158aa3a97ab99898b328d497b2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gamulogger-3.2.6-py3-none-any.whl.
File metadata
- Download URL: gamulogger-3.2.6-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12215b5bb00cb755cf08c8e2cfa61ba1390ed361a061e30f5ed94fab1edbdb66
|
|
| MD5 |
9ba13dd56848b61623c93f57e9969cd6
|
|
| BLAKE2b-256 |
7c4b490e77ab079060e44d45672786c72e3d249a5d5b6b8627e7bc9575a36033
|
Provenance
The following attestation bundles were made for gamulogger-3.2.6-py3-none-any.whl:
Publisher:
OnRelease.yml on AntoineBuirey/gamuLogger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gamulogger-3.2.6-py3-none-any.whl -
Subject digest:
12215b5bb00cb755cf08c8e2cfa61ba1390ed361a061e30f5ed94fab1edbdb66 - Sigstore transparency entry: 754794991
- Sigstore integration time:
-
Permalink:
AntoineBuirey/gamuLogger@0f881c8de4f4e5158aa3a97ab99898b328d497b2 -
Branch / Tag:
refs/tags/3.2.6 - Owner: https://github.com/AntoineBuirey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
OnRelease.yml@0f881c8de4f4e5158aa3a97ab99898b328d497b2 -
Trigger Event:
release
-
Statement type: