Skip to main content

Simple logger to have fancy logs :D

Project description

Python-Logger

Logger for python that can write into stdout, create a log file at the end.

Usage

Colors

There are multiple colors available, you can use them using Colors.

Types of log

  • log, normal logs

  • warn

  • error

  • debug, can be disabled with parameter self.debug (debug=False in constructor)

  • success

  • failed

Layout functions

  • section, create a separation to arrange your logs
................................. SECTION .................................
  • cadre, create a rectangle with text inside
################################################################################
#                                                                              #
#                                                                              #
#                                    CADRE                                     #
#                                                                              #
#                                                                              #
################################################################################

Macros

  • init, Create a cadre and start timer
  • end, stop timer, create a last log with total duration and save into file

Waiters

There are some waiters to track your process progress:

  • waiting_time: print the running time of a process
My message 4h 2min 42sec
  • waiting_animation: print an animated wheel next to a custom message for a duration
[/] My message
  • progress_bar: display a loading bar with a given advencement (ex: 0.42 stands for 42%)
[11%] [■■■■■.............................................]

Example

Here is a code exampleto show posibilities

from logger_pauwels import Logger, Colors
import time

l = Logger(debug=False)
l.init(msg="Logger Pauwels demonstration")
l.log("Testing log system")
l.section("Progress bar", char=".", color=Colors.YELLOW)

steps = 200
duration = 5    # In seconds
for i in range(steps):
    l.progress_bar(i/steps, color=Colors.YELLOW)
    time.sleep(duration / steps)

l.cadre("Waiting time", color=Colors.BLUE)

for i in range(steps):
    l.waiting_time(i/duration)
    time.sleep(duration / steps)

l.cadre("Thanks for using me :D", color=Colors.RED)

l.end()

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

logger_pauwels-0.1.5.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

logger_pauwels-0.1.5-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file logger_pauwels-0.1.5.tar.gz.

File metadata

  • Download URL: logger_pauwels-0.1.5.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for logger_pauwels-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ff143ed733c4cbcee7b55f0b45cbc63a1d8a0453b931e240667a78defc42a9a9
MD5 b2a572b84e06188219bad90fda3455a1
BLAKE2b-256 f973fd04d58885448c9d45567697f40e3dc92108e37b7a0ec6c585e6ad67e1e1

See more details on using hashes here.

File details

Details for the file logger_pauwels-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: logger_pauwels-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for logger_pauwels-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8a69a4bad8708313223b860462ad26f3cb2b7ff8cb12f1e0b86004c72a9ac6b7
MD5 e291310b480ecc0a6e5c0325eb372257
BLAKE2b-256 1681194451929e5ee526873e2e5baf1348b61cc51c4ff1d16aa4585512913134

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