a simple log for small project
Project description
fly_log
最简单的日志,比 print 函数,多了时间与源文件信息。用于比较小的python项目,是适合的。
from fly_log import debug_print as print, log_time, set_log_to_file
特点
功能简单,小的程序非常适用
与print函数一致,如果影响效率,注释掉相应的代码
@log_time 打印函数运行的时间,如果影响效率,注释掉相应的代码
安装说明
代码对 Python 3 兼容
- 全自动安装:
pip install fly-log/pip3 install fly-log
代码示例
from fly_log import debug_print as print
import time
def test1():
print("my fly log ")
@log_time
def test2():
time.sleep(0.5)
def test3():
set_log_to_file("logs/a.log")
print("aaa")
test1()
test2()
# 输出这样的格式
# 2023-03-26 19:50:04.338 test1(fly_log_sample_dev_run.py:6) my fly log
# 2023-03-26 19:50:04.843 test2() (fly_log_sample_dev_run.py:15) time cost 0.504 sec
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fly_log-0.3.1.tar.gz
(3.7 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 fly_log-0.3.1.tar.gz.
File metadata
- Download URL: fly_log-0.3.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a12557eab48cca465615b48384a297e280d17866087be2dafde54fc3c6fc4539
|
|
| MD5 |
e11ac081a84a908b859b0d9877020eed
|
|
| BLAKE2b-256 |
58787a454eff83af32206e841376f8fdd41ffd3d3fdab4c0107c453b5c3d867b
|
File details
Details for the file fly_log-0.3.1-py3-none-any.whl.
File metadata
- Download URL: fly_log-0.3.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
315726a233437fdfa5ea52cf4fadff29b3011937fbe7e3c9fab609c07eea16ca
|
|
| MD5 |
d5f68a57d40b678358a19a353d2d554e
|
|
| BLAKE2b-256 |
79c33fd52f98e7cd51a1f4da52efac3639f5a58c3f0c945c336ffa716578f62f
|