Colored log that also stores a properly formated csv.
Project description
Log
Colored log that also stores a properly formated csv
.
Installation
You can install it with pip by running:
pip install v-log
Usage
It works very similar to the regular logging
library:
from v_log import VLogger
log = VLogger(__name__)
log.critical("critical")
log.error("error")
log.warning("warning")
log.info("info")
log.debug("debug")
It can also show execution times and errors:
# Show time
log.info("Test time", time=10)
# Show error
try:
1 / 0
except Exception as e:
log.error("Try errors", error=e)
log.error("Try errors %s", "full", time=10, error=e)
This will output the following:
Customization
When creating the VLogger
instance you can define:
param | description | default |
---|---|---|
module_name | name of the module | "base" |
uri_log | uri of the file where log will be stored | "log.csv" |
file_log_level | minimum level of log events in order to be writed | logging.INFO |
console_log_level | minimum level of log events in order to be printed | logging.INFO |
csv_separator | csv separator | ";" |
base_path | name of the root folder of the execution | "src" |
for example you could do:
import logging
from v_log import VLogger
log = VLogger(__name__, uri_log="data/log.log", file_log_level=logging.WARNING)
Authors
License
The content of this repository is licensed under a MIT.
Nomenclature
Branches and commits use some prefixes to keep everything better organized.
Branches
- f/: features
- r/: releases
- h/: hotfixs
Commits
- [NEW] new features
- [FIX] fixes
- [REF] refactors
- [PYL] pylint improvements
- [TST] tests
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
v_log-1.0.1.tar.gz
(6.0 kB
view details)
Built Distribution
v_log-1.0.1-py3-none-any.whl
(6.9 kB
view details)
File details
Details for the file v_log-1.0.1.tar.gz
.
File metadata
- Download URL: v_log-1.0.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 123730a8fbe28cd0db5cbe147767a95f693d506028aeebf6093676edcbfe727d |
|
MD5 | 32de78d5e70fe60ab433fb7c4caf7aa0 |
|
BLAKE2b-256 | b9d0f88510ede9f101cf5cd778c167ef1bbc20d537c4db4d07f6b954180c8df5 |
File details
Details for the file v_log-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: v_log-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f56a05a77dcf574071df56855725d01ef4827dbe5c279ecc7a2a67577cbee548 |
|
MD5 | 0ddc6d54a3613f7daa09c9b87d4cd978 |
|
BLAKE2b-256 | e104fc5168d450c4d00b817eabbb77f9f216189fb8c58bb1da8770abe2df5682 |