verbose logger.
Project description
wanlogger
A simple Python logger that can output logs while correcting the time via NTP.
Supports console (color display) and file output.
Usage
You can create a log with:
log(text, level)
If the level is not specified, it defaults to info.
Example:
import wanlogger
logger = wanlogger.Logger()
log = logger.log
log("hello") # [info ] [20:50:19] hello
log("warning", 1) # [warn ] [20:50:19] warning
log("error", 2) # [error] [20:50:19] error
Log Levels
| Value | Content |
|---|---|
| 0 | info |
| 1 | warn |
| 2 | error |
| 3 | debug |
Can also be specified as a string:
logger.log("custom", "TEST")
Changing the Format
Can be changed when creating the class or via logger.formatchanger.
| Variable | Content |
|---|---|
| %t | Time |
| %i | Level |
| %e | Message |
By default, it is displayed as follows:
Example of a custom format:
File Output
Off by default.
Files with the same name are automatically numbered sequentially.
Example:
logger = Logger(outputfile=True, file_path="logs")
NTP Time Sync
Uses time obtained via NTP.
Resyncs every 30 minutes by default.
Can be turned off by setting timesync to False when creating the class.
Others
- timestyle
- Change the format of the time shown in the log.
- offset
- Outputs the offset between the local time and the NTP server.
- Sync is not updated.
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 wanlogger-1.2.6.tar.gz.
File metadata
- Download URL: wanlogger-1.2.6.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd26637766d640f4a7c6f02aa17b418b86ac29eaf40a3d3e24d054b1da3a40e6
|
|
| MD5 |
f1434b228156b1b9209311bce0179598
|
|
| BLAKE2b-256 |
bdc0d9800be093f1f9d0a58d376d6e33f87ab1ffea1aa6c6f8ffaed939e3203d
|
File details
Details for the file wanlogger-1.2.6-py3-none-any.whl.
File metadata
- Download URL: wanlogger-1.2.6-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd2bd4ba28bd859b7a587cb3e3b466abee66036386e3298f5f7a194b752f26f8
|
|
| MD5 |
5e4aea306b99b9e74dba1bb53f214894
|
|
| BLAKE2b-256 |
84cd0211168b0d811d74432b1d5bec1490d1aee3be97355f04258f8ce0549dfb
|