Skip to main content

spylogger

Generic python logging library.

Documentation: https://github.com/SPSCommerce/spylogger

Installation

basic loggers

This installs spylogger only and will load the loggers with no external dependency requirements.

pip install spylogger

pretty loggers

This installs spylogger, pygments, and pygments-json and loads the basic loggers along with pretty loggers.

pip install spylogger[pretty]

Configuration

Environment Variables

Name

Description

Default

SPY_LOG_LOGGER

The configured logger name. Available loggers:

  • json-flat (Default)

  • json

  • json-src-key

  • pretty

  • ugly

json-flat

SPY_LOG_LEVEL

The python log level. See the docs

WARNING

SPY_SHOW_META

Flag for showing the __meta output.

True

SPY_JSON_LOG_KEYS

A list of log record keys to put in the __meta section of the log message.

Available Keys:

  • args

  • created

  • exc_info

  • exc_text

  • filename

  • funcName

  • levelname

  • levelno

  • lineno

  • module

  • msecs

  • msg

  • name

  • pathname

  • process

  • processName

  • relativeCreated

  • thread

  • threadName

See the python docs

  • args

  • funcName

  • levelname

  • lineno

  • module

  • pathname

  • process

  • threadName

Pretty Formatter Styles

See the pygments documentation

Environment Variables

Name

Default

SPY_LOG_FORMATTER_DEBUG

autumn

SPY_LOG_FORMATTER_INFO

monokai

SPY_LOG_FORMATTER_WARNING

fruity

SPY_LOG_FORMATTER_ERROR

default

SPY_LOG_FORMATTER_CRITICAL

vs

Available styles

  • algol

  • algol_nu

  • autumn

  • borland

  • bw

  • colorful

  • default

  • emacs

  • friendly

  • fruity

  • igor

  • lovelace

  • manni

  • monokai

  • murphy

  • native

  • paraiso-dark

  • paraiso-light

  • pastie

  • perldoc

  • rrt

  • tango

  • trac

  • vim

  • vs

  • xcode

Usage

from spylogger import get_logger

# get_logger(name=SPY_LOG_LOGGER, log_level=SPY_LOG_LEVEL)
logger = get_logger()

logger.info({'string': 'test Pretty info message.', 'int': 42, 'bool': True})

More examples are in example.py

Authors

See contributors section on GitHub.

Metadata

Release files for spylogger 1.1.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 spylogger 1.1.0
File Size Uploaded Provenance Actions
spylogger-1.1.0.tar.gz 4.9 kB Without provenance Details for spylogger-1.1.0.tar.gz

Release files / spylogger-1.1.0.tar.gz

Download URL spylogger-1.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5981934838d8f67889e1d56a43f3e9af229a1abe6dda2910c4d1603e58077419
BLAKE2b-256 checksum
How to use checksums
93b60b41f8cfac5a11a1b8e6bcd82b3140a5e6c08805058be162d703754c66d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for spylogger 1.1.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