Skip to main content

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: default style log

Example of a custom format: custom style log

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wanlogger-1.2.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wanlogger-1.2.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file wanlogger-1.2.0.tar.gz.

File metadata

  • Download URL: wanlogger-1.2.0.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

Hashes for wanlogger-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c27f35ae30b0e1fad4222f5d5a8c2439f0e9652bf86009c6e79d7770f09b6b9e
MD5 a88ac74320b61ea89748a8a0ddd3650e
BLAKE2b-256 04a16df0afaf160eba6f7e8a26e95415fe532ee8bec2b812d4c912a98efc4030

See more details on using hashes here.

File details

Details for the file wanlogger-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: wanlogger-1.2.0-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

Hashes for wanlogger-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b04ec2c2d8595104cfad78d12e0f7c121f485b51918456e1b06c10cf4872be2
MD5 c479a1b4244a9175de4d8c4f64b01817
BLAKE2b-256 8281736a5ef7aec0fb88fc4c0b64e0700f097976171fe81e39803675044a09e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page