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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kogger-0.1.4.tar.gz.
File metadata
- Download URL: kogger-0.1.4.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb847c85879e8376997eae2a44f2bf3b8ef578ff910e3fafd829ef8092f1f530
|
|
| MD5 |
fa2fb3f0bd5c38301d05ef717a47f089
|
|
| BLAKE2b-256 |
73611c73123308f514bfa659599f2416772c4b6fe8b4952109efe5771fdcfd2f
|
File details
Details for the file kogger-0.1.4-py3-none-any.whl.
File metadata
- Download URL: kogger-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fe57972bca708c798e97d72bb9b10f015e48657ade3cdd21f44c36db4e41484
|
|
| MD5 |
dad5392ef1f12158979679d39e9b75bb
|
|
| BLAKE2b-256 |
c9d5d5af180e200bbd1fb787295d0b7e39efb6bb7aa270f02f15eb148e08acbc
|