Skip to main content

Format-Logger

Format Logger allows you to have a nice looking log, with relevant information as function and time, and calculate the elapsed time during the functions, with a easy to use structure.

Install

pip install format-logger

Example

from format_logger.logger import logger

def foo_function(log : logger) -> None:
    log = log.start_function("foo_function")

    log.INFO("Hello World!")
    time.sleep(1)

    log.end_function()

if __name__ == "__main__":

    log = logger("logger_example", "main")

    foo_function(log)

    log.end_function()

Output:

logger_example | main | 2024-10-09 17:19:18.563839 | INFO | Starting function main at 2024-10-09 17:19:18.563839

logger_example | foo_function | 2024-10-09 17:19:18.563839 | INFO | Starting function foo_function at 2024-10-09 17:19:18.563839

logger_example | foo_function | 2024-10-09 17:19:18.563839 | INFO | Hello World!

logger_example | foo_function | 2024-10-09 17:19:19.564759 | INFO | Function foo_function ended - time 1.00092 Seconds

logger_example | main | 2024-10-09 17:19:19.564759 | INFO | Function main ended - time 1.00092 Seconds

Release files for format-logger 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for format-logger 0.0.5
File Size Uploaded
format_logger-0.0.5.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for format-logger 0.0.5
File Interpreter ABI Platform
format_logger-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / format_logger-0.0.5.tar.gz

Download URL format_logger-0.0.5.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
11a38b1c8a990091ea974fdcd305f98d57e45c3078c7346271d81572ec95319b
BLAKE2b-256 checksum
How to use checksums
a5097fd5af773d0da7076c5d52936609e4547fb2490efec717663ec5260f1664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.3

Release files / format_logger-0.0.5-py3-none-any.whl

Download URL format_logger-0.0.5-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c48db7c25deab83c576e911bc601ef006e2c260fabef55ec2cc4710930c93210
BLAKE2b-256 checksum
How to use checksums
aded892e686148fe8a228d8803d48befd4242be5a124177541e16248e5ef4e83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page