Skip to main content

Description.

Project description

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

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

format_logger-0.0.5.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

format_logger-0.0.5-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file format_logger-0.0.5.tar.gz.

File metadata

  • Download URL: format_logger-0.0.5.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for format_logger-0.0.5.tar.gz
Algorithm Hash digest
SHA256 11a38b1c8a990091ea974fdcd305f98d57e45c3078c7346271d81572ec95319b
MD5 64abc688ead08f49a1dbd15c0e85e7f4
BLAKE2b-256 a5097fd5af773d0da7076c5d52936609e4547fb2490efec717663ec5260f1664

See more details on using hashes here.

File details

Details for the file format_logger-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: format_logger-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for format_logger-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c48db7c25deab83c576e911bc601ef006e2c260fabef55ec2cc4710930c93210
MD5 5e9985006fb42517882146bf85ab48ac
BLAKE2b-256 aded892e686148fe8a228d8803d48befd4242be5a124177541e16248e5ef4e83

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