Helper for logging to files
Project description
fileloghelper
A simple helper for logging content to files (and displaying it)
Installation
pip3 install fileloghelper
Methods
- set_context(context): specifies context which will be added to all outputs (file & terminal) in front
- success(text, display=True): writes text to file and optionally with green indication in console (if display==True)
- debug(text, display=True): writes text to file and optionally with blue indication in console (if display==True)
- warning(text, display=True): writes text to file and optionally with yellow indication in console (if display==True)
- error(text, display=True): writes text to file and optionally with red indication in console (if display==True)
- plain(text, display=False, extra_long): write and optionally display text to file. extra_long specifies time format (12:34:56; 12:34:56:123456)
- save(): save file under default/at declaration specified filename
Example
from fileloghelper import Logger
logger = Logger(filename='log.txt', context='MyLogger')
logger.debug('Hello World!', display=False)
logger.success('Successfull!', display=True)
logger.save()
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
fileloghelper-0.0.4.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for fileloghelper-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00137e304c2a05b91824c8ea74e8dffb2a797984e9f18fbcfbe0ece9d6358260 |
|
MD5 | b83210e7f86b54c49df8b71c667e97ba |
|
BLAKE2b-256 | fced49ec869f017f6ebf4c4be6c44f1c30527f03ac73065c40e915d27cb5fa0f |