Skip to main content

A global logger with automatic configuration loading

Project description

Globalog

A Python package providing a global logger with automatic configuration loading.

Installation

pip install globalog

Usage

from globalog import LOG

# The logger will automatically load configuration from the nearest config file
LOG.info("This is an info message")
LOG.debug("This is a debug message")

# You can also explicitly initialize with a specific config file
LOG.init(config_file="path/to/config.json")

Configuration

The package looks for configuration files in the following order:

  1. logging_config.json in the current directory
  2. logging_config.yaml in the current directory
  3. Default configuration if no config file is found

Example configuration file (logging_config.json):

{
    "version": 1,
    "disable_existing_loggers": false,
    "formatters": {
        "standard": {
            "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
        }
    },
    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
            "level": "INFO",
            "formatter": "standard",
            "stream": "ext://sys.stdout"
        }
    },
    "loggers": {
        "": {
            "handlers": ["console"],
            "level": "INFO",
            "propagate": true
        }
    }
}

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

globalog-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

globalog-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file globalog-0.1.0.tar.gz.

File metadata

  • Download URL: globalog-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for globalog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7c2b5473a553ca41fe3c7ad41baf32bb9f7f174bdcc3dad3c4d095d100db46c2
MD5 716882d3067f79572fd677db4baadd28
BLAKE2b-256 eb02421ef9c99fb447ebc1379f05f99359c9ea7a1d48325d59e4afde47a9fda2

See more details on using hashes here.

Provenance

The following attestation bundles were made for globalog-0.1.0.tar.gz:

Publisher: python-publish.yml on ronpik/globalog

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

File details

Details for the file globalog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: globalog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for globalog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb74479e51afda515104535c226605417b8e6e1037c255ef16d3a7966d5145a4
MD5 8ef867a6ae07c6ae89dc6ccb35459b8c
BLAKE2b-256 f591fc020b558b468e24828c22b4639f9339a1eb2c46b07a3f1f4a9f939f2f16

See more details on using hashes here.

Provenance

The following attestation bundles were made for globalog-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on ronpik/globalog

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

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