Log information: Print the log, export the log file.
Project description
ykenan_log
Print and save a simple log to a file
This is a simple log package. You can see Github-ykenan_log PyPI-ykenan_log
upload
py -m build
twine check dist/*
twine upload dist/*
Use
install
pip install ykenan_log
use
# -*- coding: utf-8 -*-
from ykenan_log import Logger
log = Logger("name", "log")
if __name__ == '__main__':
print("run...")
log.debug("info......")
log.info("info......")
log.warning("info......")
log.error("info......")
output
2023-03-17 09:21:36 root name[34768] DEBUG info......
2023-03-17 09:21:36 root name[34768] INFO info......
2023-03-17 09:21:36 root name[34768] WARNING info......
2023-03-17 09:21:36 root name[34768] ERROR info......
Introduction
main function
ykenan_log.
Logger(name: str = None,
log_path: str = None,
level: str = "INFO",
is_solitary: bool = True,
is_form_file: bool = False,
size: int = 104857600,
backup_count: int = 10,
encoding: str = "UTF-8"
)
:param name: Project Name
:param log_path: Log file output path. Default is log_%Y%m%d.log.
:param level: Log printing level. Default is INFO.
:param is_solitary: When the file path is consistent (here, the log_path parameter is not a specific file name, but a file path), whether the file is formed independently according to the name parameter. Default is True.
:param is_form_file: Whether to form a log file. Default is False.
:param size: Setting the file size if a file is formed. Default is 104857600. (100MB)
:param backup_count: Setting the number of rotating files if a file is formed. Default is 10.
:param encoding: Setting of file encoding if a file is formed. Default is UTF-8.
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
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 ykenan_log-0.2.5.tar.gz.
File metadata
- Download URL: ykenan_log-0.2.5.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec7cc6c9cb82312d28ae4114d9ac022acbb9aab8dd4404abf62bbe411910e7ab
|
|
| MD5 |
0312c8e266f19332cfdc6839aac01078
|
|
| BLAKE2b-256 |
bd0a8e687904dbfc6b3fedceaba6e7ea0ead6e946d0b103dd0a33d4a6da88c83
|
File details
Details for the file ykenan_log-0.2.5-py3-none-any.whl.
File metadata
- Download URL: ykenan_log-0.2.5-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e55870e65558b297cdf1d5615242d5248ba4e2c43881a76a82756bf34968b470
|
|
| MD5 |
23fcec658dfe1522a9d090dee3a17f1a
|
|
| BLAKE2b-256 |
ed51c5934babec39939355165b1b5eeac2916a3388455dfd09d3284134a62f90
|