Easy logging
Project description
kellog
Extremely easy to use python print()
replacement with coloured output and status icons.
Installation
pip install kellog
Requires python version 3.7 or above.
Usage
It is very very simple to start using this right away:
from kellog import debug, info, warning, error, critical
debug("Debug message")
info(f"Five plus six is {5 + 6}")
warning("f-strings are better than", "comma-separated", "arguments")
error("Exception")
critical("DEFCON 1")
kellog
wraps the built-in logging
library, so it can be controlled in the same ways.
For instance, logging to file and configuring the output format.
class Kellog(
path: Path | None,
name: str,
prefixes: dict[str, str] | None,
append: bool,
)
Parameters
----------
path, optional
Output file, by default None
name, optional
Reset the logger name to this, by default "kellog"
prefixes, optional
Set the log message prefixes (does not automatically add separating whitespace), by default None.
The dictionary keys to set are "debug", "info", "warning", "error", "critical".
Setting to None will use the default unicode prefixes, from codicons: .
append, optional
If False, delete the contents of `path` first, by default True
Tests
Install this package with:
pip install -e .[dev]
Then run the tests:
make tests
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
kellog-1.0.1.tar.gz
(42.3 kB
view details)
Built Distribution
kellog-1.0.1-py3-none-any.whl
(29.5 kB
view details)
File details
Details for the file kellog-1.0.1.tar.gz
.
File metadata
- Download URL: kellog-1.0.1.tar.gz
- Upload date:
- Size: 42.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36a550e39c31933f894a0c047292addc1624dff33ad98a633fecf1a08e6cd453 |
|
MD5 | 9b91991ee225ac7dc8a012e70cb91fb2 |
|
BLAKE2b-256 | f2e50d5d1e4819d2b5e7b3ee09fcf575bb2864f44da97ea1ca946d0f4d4357a6 |
File details
Details for the file kellog-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: kellog-1.0.1-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9476c2b74d45557b5226a670df6d7eaaf9db9f62e730271353811f406cf7b8ee |
|
MD5 | cb3a6d0069856ab45daa5ae9bdf8c486 |
|
BLAKE2b-256 | dbb91681d0f6dd559599812f0c47600e61004b014781753364109cda26f48067 |