Skip to main content

Python LINZ Logger

GitHub Actions Status Kodiak Dependabot Status License Conventional Commits Code Style

Why?

LINZ has a standard logging format based loosely on the pinojs logging format:

{
  "level": 30,
  "time": 1571696532994,
  "pid": 10671,
  "hostname": "Ubuntu1",
  "id": "01DQR6KQG0K60TP4T1C4VC5P74",
  "msg": "SomeMessage",
  "v": 1
}

Usage

pip install --upgrade linz-logger
from os import environ

from linz_logger import get_log, set_level, LogLevel

set_level(LogLevel[environ.get("LOGLEVEL", "WARNING").lower()].value)
set_contextvars({"country": "NZ"}) # remove_contextvars(["country"]) to remove a key
get_log().error('Hello World', key="value")
# {"key": "value", "level": 50, "time": 1601555605017, "v": 1, "pid": 311800, "id": "01G9XAA1MCMX2K9NZN9GJJHN71", "msg": "Hello World", "hostname": "Ubuntu1", "country": "NZ"}

Metadata

Release files for linz_logger 0.9.0

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

Source distribution (sdist)

Source distribution for linz_logger 0.9.0
File Size Uploaded Provenance Actions
linz_logger-0.9.0.tar.gz 4.4 kB Without provenance Details for linz_logger-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for linz_logger 0.9.0
File Interpreter ABI Platform Actions
linz_logger-0.9.0-py3-none-any.whl Python 3 none any Details for linz_logger-0.9.0-py3-none-any.whl

Total release size: 9.2 kB

Release files / linz_logger-0.9.0.tar.gz

Download URL linz_logger-0.9.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e8282540c305fab3645f9315dadf9eb68d33f9c0bcdea0586662333fd1836425
BLAKE2b-256 checksum
How to use checksums
870f756864dc4ec0dd8a9249fdb1f9cbaa703d25fc1022e437883ada51d845e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-1014-azure

Release files / linz_logger-0.9.0-py3-none-any.whl

Download URL linz_logger-0.9.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31cd8ea27fbf79330727b10f3fae242afc59a7399833c4ff0cb3392869f616c0
BLAKE2b-256 checksum
How to use checksums
3cf7e27e9f1c1d949bc85abffc88a075e33d8309ea8ef8ef79f09d0636f3a688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-1014-azure

Security for linz_logger 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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