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 with a name.


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")
10:13: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%

There's much more you can do with this library, and I encourage you to play around. Some features include file logging, custom callbacks and more.

Check out the GitHub: https://github.com/BareAlek/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.1.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

styledlogger-0.1.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for styledlogger-0.1.3.tar.gz
Algorithm Hash digest
SHA256 14ea54876cd566575cc8334090a5423cd4b6a02d1e78741b4fd190e7c17365d0
MD5 33ec4c9d1938636aad98cadaecc0725a
BLAKE2b-256 7ce03d5086924669a5cc45cbe6eaf2f11e067d1fd7b7149743038270239538b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: styledlogger-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for styledlogger-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 77a6cdb1a6273534328f961f1c8d01d4464583b4349aaad4fdf87bb738641587
MD5 15af6153d91dac4279b93c5ff3646ce9
BLAKE2b-256 c3daaae5764ee7e03a8958bfee5cbc9332789c494c960af3ede2ab5682d84de6

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