Skip to main content

Logging

Project description

logmag

This library defines a simple logging system with different log levels and colored output for different levels.

Installation

You can install the Logger Library using pip:

pip install logmag

Usage

Initializing the Logger:

from logger import Logger

Create a logger

my_logger = Logger('my_logger')

Logging Messages:

The Logger provides five levels of logging: DEBUG, INFO, WARNING, ERROR, and CRITICAL.

Debug Messages:
my_logger.debug('This is a debug message')
Info Messages:
my_logger.info('This is an informational message')
Warning Messages:
my_logger.warning('This is a warning')
Error Messages:
my_logger.error('This is an error message')
Critical Messages:
my_logger.critical('This is a critical error')

The messages will be printed to the console with timestamps and colored according to their severity.

Example

# Example Usage
from logmag import Logger

my_logger = Logger('my_logger')

my_logger.debug('This is a debug message')
my_logger.info('This is an informational message')
my_logger.warning('This is a warning')
my_logger.error('This is an error message')
my_logger.critical('This is a critical error')

Contact

For questions, bug reports, or contributions, please visit the Gitlab repository: https://gitlab.com/test4521437/a3.

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

logmag-1.2.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file logmag-1.2.tar.gz.

File metadata

  • Download URL: logmag-1.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for logmag-1.2.tar.gz
Algorithm Hash digest
SHA256 7c6ac26f1b9efdb49d70a8987a18adda52200033a1f13219afa49a743ee53a73
MD5 d5b69e6871eaed5e5fe01be82296a13b
BLAKE2b-256 31125fc08446a4369a527dc81a5a18d204d9380e5446be92a1330652318a8678

See more details on using hashes here.

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