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.2.tar.gz
(6.7 kB
view details)
Built Distribution
File details
Details for the file styledlogger-0.1.2.tar.gz
.
File metadata
- Download URL: styledlogger-0.1.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d95f85771a545cd584d8f004d9223a5cf8a6c08c4d4d0cfc39be500bd343b8c0 |
|
MD5 | 1d7baf1cf98153207a858bc7c04230a6 |
|
BLAKE2b-256 | 15ace2530e6d9e430bac297e5035403ad5e13d5cdb788f353d612424dad120d3 |
File details
Details for the file styledlogger-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: styledlogger-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.5 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 | 6b88bd4a86d3fb9f7df82ffcecfac3e266142de37e56247caae8bf6521be55fb |
|
MD5 | 6fc14c580f0c298b4f111dcd7025cfab |
|
BLAKE2b-256 | 88083a7395ab4cf921d1e3b999bdb709a911fe48cf622c668d86bf39fcec6c12 |