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")
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%

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.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

styledlogger-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: styledlogger-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 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.0.tar.gz
Algorithm Hash digest
SHA256 88da742d4a0922ef76b89d374bd4dc1b09e9054dde6eed60e92559e9fe06c1fc
MD5 d1e83d54b42d64c505b74a2a87dffd07
BLAKE2b-256 d1e4fb4da684880a6f1b2ae92964b29f22fbb1fda091dd05728fb9e7f2dd456d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: styledlogger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7319cfedcdd2dc8bd5c7513daa591bdbb11fb3e9d019bbe4a152a74dfeb8921
MD5 52ba12953d2458b69a0d2864a050fab6
BLAKE2b-256 d9c162b181d49c8716021a82ff3357935805571b4b9bc2ab3af637f04f7f3644

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