Skip to main content

micro-logger

A JSON logger made for microservices

Usage

import micro_logger

# This overrides the root logger as well

logger = micro_logger.getLogger("my-service")

logger.info("sure", extra={"a": 1})

Testing

import micro_logger_unittest

import micro_logger

# Use this class as a base

class TestUnitTest(micro_logger_unittest.TestCase):

    # Override for all tests

    @unittest.mock.patch("micro_logger.getLogger", micro_logger_unittest.MockLogger)
    def setUp(self):

        self.logger = micro_logger.getLogger("unit")

    # Any test can check for logging

    def test_assertLogged(self):

        self.logger.info("sure", extra={"a": 1})

        self.assertLogged(self.logger, "info", "sure", extra={"a": 1})

Release files for micro-logger 0.1.4

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

Source distribution (sdist)

Source distribution for micro-logger 0.1.4
File Size Uploaded
micro-logger-0.1.4.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for micro-logger 0.1.4
File Interpreter ABI Platform
micro_logger-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / micro-logger-0.1.4.tar.gz

Download URL micro-logger-0.1.4.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
12e8536b81e0fb620ae562c3f24866019a0198f9194193a45f95001f932df754
BLAKE2b-256 checksum
How to use checksums
54bceb2b4933202764fa8b40a7a24df50eab1a4c5083dc05a63a061f98a3ceb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Release files / micro_logger-0.1.4-py3-none-any.whl

Download URL micro_logger-0.1.4-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4420f632b66c6f64cb53a653d5fe26b6002e4d307d6e66bd5dc09c02eec93fdf
BLAKE2b-256 checksum
How to use checksums
7446bc826a82b8021b276083e0496ada740e85f6d1026ec9770dfe6a2998f77a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release 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