A very simple logger.
Project description
Kogger
This is a very simple logger.
Install
pip install kogger
# or pip install git+https://github.com/zengbocheng/kogger.git
Usage
There are two basic methods to use it.
Create a Logger Object
from kogger import Logger
logger = Logger('__main__')
# logger = Logger('__main__', stream='out.log')
# logger = Logger()
logger.info('Hello, world!')
logger.warning('Hello, world!')
logger.error('Hello, world!')
The output of is
[2023-04-11 23:26:38] [__MAIN__] [INFO] Hello, world!
[2023-04-11 23:26:38] [__MAIN__] [WARNING] Hello, world!
[2023-04-11 23:26:38] [__MAIN__] [ERROR] Hello, world!
Use the Default Logger of Package
import kogger
# kogger.set_name('__main__')
# kogger.set_file('out.log')
kogger.info('Hello, world!')
Warning
If you use the logger in multiple processes to output logs synchronously into the same file, the behaviors are undefined. You have better to find another package supporting multiple processes.
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
kogger-0.1.4.tar.gz
(2.9 kB
view hashes)
Built Distribution
kogger-0.1.4-py3-none-any.whl
(3.4 kB
view hashes)