Skip to main content

A simple, styled logging library.

Project description

StyledLogger

A simple - yet beautiful logging library for Python 🐍 > 3.7

To use, simply install via pip install styledlogger

Then you can import the StyledLogger class from the styledlogger package, and initialize it.

Simple example using a logger:

>>> from styledlogger import StyledLogger

>>> logger = StyledLogger(name="Main") # Initialize a logger named "Main"
>>> logger.set_level(0) # Enable debug - default level is 1, which means every log type except debug. Setting the level to 0 enables the debug logs.

>>> logger.debug("This is just a test print")
9:55:30 :: DEBU @ Main - This is just a test print

>>> logger.error("Could not fetch url 'https://example.com'")
10:15:14 :: ERRO @ Main - Could not fetch url 'https://example.com'

>>> from styledlogger import StyleConfig

>>> logger.set_style(StyleConfig( text_format="(%time%) | %type% - %msg%", time_format='DD/MM/YYYY hh:mm' )) # Change the text format and time format in the logs. Placeholders you can use are: %name%, %time%, %type% and %msg%.

>>> logger.warn("CPU usage exceeding 90%")
(22/04/2023 10:01) | WARN - CPU usage exceeding 90%

Check out the GitHub: https://github.com/SpLayzDK/StyledLogger Contact me at mail: alek@imalek.me

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

styledlogger-0.0.5.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

styledlogger-0.0.5-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file styledlogger-0.0.5.tar.gz.

File metadata

  • Download URL: styledlogger-0.0.5.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for styledlogger-0.0.5.tar.gz
Algorithm Hash digest
SHA256 60c7844caa2525717cb93f4ea7302b7ee8a50645009c94ee88d8f237433a2d54
MD5 41c34f6cb133ab7a0ad46d8e0afa8c4e
BLAKE2b-256 2933b2ae70ef3256356ea5514c7dae188c8e6cfe17fb3d39fab8d7ee16bf91b3

See more details on using hashes here.

File details

Details for the file styledlogger-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for styledlogger-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bddd7267965c1d5658f27cc6030d5d8cdaf43e9f79ca894c49e2cb6473498c83
MD5 561f124cf433fa9157f2353c0e1665fe
BLAKE2b-256 870c7822a08105b2763a88990a820c97d476193bca0392d37e4ba58bb572902f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page