Skip to main content

A logger python project

 ,-----------------------------------------------------------------v
 u           ,-~~\   <~)_   u\             /\    ,-.       ,-.     u
 u  _,===-.,  (   \   ( v~\ u u  _,===-.,  \/   <,- \_____/  `     u
 u (______,.   u\. \   \_/'  \u (______,. /__\    /  ___. \  -===- u
 u            _a_a`\\  /\     u           \--/ ,_(__/ ,_(__\       u
 `--------------------------------------------- By CenturyBoys ----y

This is a non block JSON logger that use python's default logger with a thread executor.

By default loglifos set the default root loger to ERROR level

Settings

You can change loglifos log level using set_config method. Loglifos use the same level constants as the default logging python lib.

import loglifos

loglifos.set_config(loglifos.ERROR)

Using

import loglifos

try:
    a = 1 / 0 
except Exception as e:
    loglifos.debug("Message from debug", "some args", 1, some__kwargs="Kwargs of debug")
    loglifos.info("Message from info", "some args", 1, some__kwargs="Kwargs of info")
    loglifos.warning("Message from warning", "some args", 1, some__kwargs="Kwargs of warning")
    loglifos.error("Message from error", "some args", 1, some__kwargs="Kwargs of error", exception=e)
    loglifos.critical("Message from critical", "some args", 1, some__kwargs="Kwargs of critical")
{"time": "2023-01-25 13:27:34.896765", "level": "ERROR", "file": "/home/marco/.config/JetBrains/PyCharmCE2022.3/scratche
  s/scratch_1.py", "function": "<module>", "msg": "Message from error", "some__kwargs": "'Kwargs of error'", "args": "('
  some args', 1)", "error": "Traceback (most recent call last):\n  File \"/home/marco/.config/JetBrains/PyCharmCE2022.3/
  scratches/scratch_1.py\", line 9, in <module>\n    a = 1 / 0\nZeroDivisionError: division by zero\n"}
{"time": "2023-01-25 13:27:34.899420", "level": "DEBUG", "file": "/home/marco/.config/JetBrains/PyCharmCE2022.3/scratche
  s/scratch_1.py", "function": "<module>", "msg": "Message from debug", "some__kwargs": "'Kwargs of debug'", "args": "('
  some args', 1)"}
{"time": "2023-01-25 13:27:34.899676", "level": "INFO", "file": "/home/marco/.config/JetBrains/PyCharmCE2022.3/scratches
  /scratch_1.py", "function": "<module>", "msg": "Message from info", "some__kwargs": "'Kwargs of info'", "args": "('som
  e args', 1)"}
{"time": "2023-01-25 13:27:34.899885", "level": "WARNING", "file": "/home/marco/.config/JetBrains/PyCharmCE2022.3/scratc
  hes/scratch_1.py", "function": "<module>", "msg": "Message from warning", "some__kwargs": "'Kwargs of warning'", "args
  ": "('some args', 1)"}
{"time": "2023-01-25 13:27:34.900066", "level": "CRITICAL", "file": "/home/marco/.config/JetBrains/PyCharmCE2022.3/scrat
  ches/scratch_1.py", "function": "<module>", "msg": "Message from critical", "some__kwargs": "'Kwargs of critical'", "a
  rgs": "('some args', 1)"}

Download files

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

Source Distribution

loglifos-0.3.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

loglifos-0.3.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file loglifos-0.3.0.tar.gz.

File metadata

  • Download URL: loglifos-0.3.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for loglifos-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f2c4da1f237d0ded8e31d868ed8097bf756780f0b36a832678a4ec42c13e0329
MD5 4f03b9e87862dca0d8514837bd2dde98
BLAKE2b-256 57aeea621ee3fad27cda3296f02c4ddcc39b0b547750370e889346bfdcaa6491

See more details on using hashes here.

Provenance

The following attestation bundles were made for loglifos-0.3.0.tar.gz:

Publisher: publish.yml on CenturyBoys/loglifos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loglifos-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: loglifos-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for loglifos-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcc82252b213b50f8b0b6dc4d8f421b2e87bf05a5d18c688adff6644517e4801
MD5 b5df38d4be388a6f087591fccefcde2b
BLAKE2b-256 fd3f5927955cf7e6a95e32b27610cf922369eca9b97364984dfb5971725708c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for loglifos-0.3.0-py3-none-any.whl:

Publisher: publish.yml on CenturyBoys/loglifos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 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