Skip to main content

Unified Python Utils

Project description

Unified Python Utils

Collection of python library utils

Installation

poetry add upils

How to use the logger

First, set up the logger. It accepts string like "INFO" or int 20

logger = configure_logger(20)

And then you can just use it like other logger

logger.info("info")
logger.warning("warning")

Add extra information

How to use the extra logging:

logger.bind(user="ajung", desc="smart").error(
    "Inline binding of extra attribute"
)

The output will be

{"level": "ERROR", "time": {"repr": "2023-10-04 12:03:53.043106+07:00", "timestamp": 1696395833.043106}, "message": "Inline binding of extra attribute", "file": {"name": "app.py", "path": "/Users/user/Documents/projects/de-projects/service/statistics-services/app.py"}, "line": 47, "exception": null, "extra": {"ajung": "smart"}}

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

upils-0.2.2.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

upils-0.2.2-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file upils-0.2.2.tar.gz.

File metadata

  • Download URL: upils-0.2.2.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/23.0.0

File hashes

Hashes for upils-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d66d620cc7eff21aeb27fd399d7850e6cc3abc68cef7d87accf88f180e4e8bbe
MD5 814cd0587a44085d322ea912ebad64d2
BLAKE2b-256 ad8743f064995f3eb53c7b2a6a320b05de898119f57bbfc4053f499a9a3ffb91

See more details on using hashes here.

File details

Details for the file upils-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: upils-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/23.0.0

File hashes

Hashes for upils-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 32ed3ea3db9fb3579224c1a0e233ae7db488028b1db0c20b0571d47295b71234
MD5 1d697577bc0410e237d4b1eead1cc5d9
BLAKE2b-256 6f2d13cb067d7a704f439e2a8d4d44b75cef9229205aa442a5a8a33b194e6fba

See more details on using hashes here.

Supported by

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