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
Release history Release notifications | RSS feed
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.1.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file styledlogger-0.1.1.tar.gz
.
File metadata
- Download URL: styledlogger-0.1.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f22d6b3cb2f936f14d306a1795c9ecd696217e4f048d6dc01a4d0b2a52b3260 |
|
MD5 | 20b188497205092be4925486b2ec212c |
|
BLAKE2b-256 | 5d3d958499c36b5136f865b4f052be8943409c0ce94bce6b7e450e430dfae365 |
File details
Details for the file styledlogger-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: styledlogger-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e19d3a60abed507f29bd5fd90f9a6cadbeb54c6e206ad143f3160e30179d8e7 |
|
MD5 | cf0be3e7ad684cbf483864d789bffbe9 |
|
BLAKE2b-256 | 15437d4939d056e8567280d1e28c60ded02d38be071b19637516e612689df59f |