A JSON logger made for microservices
Project description
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})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
micro-logger-0.1.4.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file micro-logger-0.1.4.tar.gz
.
File metadata
- Download URL: micro-logger-0.1.4.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12e8536b81e0fb620ae562c3f24866019a0198f9194193a45f95001f932df754 |
|
MD5 | 84c3837f1cc08f32afb24d3cad40046a |
|
BLAKE2b-256 | 54bceb2b4933202764fa8b40a7a24df50eab1a4c5083dc05a63a061f98a3ceb5 |
File details
Details for the file micro_logger-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: micro_logger-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4420f632b66c6f64cb53a653d5fe26b6002e4d307d6e66bd5dc09c02eec93fdf |
|
MD5 | 5b9f3a63d7326a4eb90571319307a869 |
|
BLAKE2b-256 | 7446bc826a82b8021b276083e0496ada740e85f6d1026ec9770dfe6a2998f77a |