Skip to main content

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 Logger class. 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


Download files

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

Source Distribution

gamulogger-3.2.6.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

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

gamulogger-3.2.6-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

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

Hashes for gamulogger-3.2.6.tar.gz
Algorithm Hash digest
SHA256 56585365b25bde23ff81a10ef70bf5e851bfa282a590ba5bc4241d9ec9c10189
MD5 8a4a0cee4bd2a6863677903fc5ee43b3
BLAKE2b-256 7cf6ea650437f0d2fa24bb12b1ae2005713dd5575b4cb40b2c7cf13f436245ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for gamulogger-3.2.6.tar.gz:

Publisher: OnRelease.yml on AntoineBuirey/gamuLogger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gamulogger-3.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 12215b5bb00cb755cf08c8e2cfa61ba1390ed361a061e30f5ed94fab1edbdb66
MD5 9ba13dd56848b61623c93f57e9969cd6
BLAKE2b-256 7c4b490e77ab079060e44d45672786c72e3d249a5d5b6b8627e7bc9575a36033

See more details on using hashes here.

Provenance

The following attestation bundles were made for gamulogger-3.2.6-py3-none-any.whl:

Publisher: OnRelease.yml on AntoineBuirey/gamuLogger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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