A simple Python structured logging library that writes JSON-formatted output to stdout
Project description
soraya_slog
soraya_slog is a simple Python structured logging library that writes JSON-formatted output to stdout. The output format is compatible with that defined for Google Cloud Logging. The library is designed to be used with projects related to Soraya, an experiment in conversational AI that can be found at the SliceOfFile GitHub organization.
Installation
soraya_slog can be installed using pip:
pip install soraya-slog
Usage
Using soraya_slog is very simple. You just need to import the library and call the log method with the message, severity level and additional data. The severity levels are compatible with those for Google Cloud Logging, and are as follows:
DEBUGINFONOTICEWARNINGERRORCRITICALALERTEMERGENCY
Here's an example.
import soraya_slog
soraya_slog.log('ERROR', 'This is an error message', { 'additional': 'data' })
You might also prefer to use any of the convenient methods available for each severity level, such as in the following example.
import soraya_slog
soraya_slog.error('This is an error message', { 'additional': 'data' })
License
soraya_slog is licensed under The Unlicense. See the LICENSE file for more information.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file soraya_slog-1.0.1.tar.gz.
File metadata
- Download URL: soraya_slog-1.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7219d6eb7a419c033d406854ecec8536cd1221059d65c9883d4c83f67e20f381
|
|
| MD5 |
48cfafad0f65ce1e7068fd98fc40096e
|
|
| BLAKE2b-256 |
2ae9c40ae6035ddb00f232b6892519ff391555334f47673ad5cf4e2ebacedacf
|
File details
Details for the file soraya_slog-1.0.1-py3-none-any.whl.
File metadata
- Download URL: soraya_slog-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a84d902fe2e58cce2510b18b4b216004ca3ff051d9447eec5a2a5a14926468b
|
|
| MD5 |
ff20a03e12b275be3abce88cca8e0e6f
|
|
| BLAKE2b-256 |
a5cce8e22c6b08b7e47e9a8524d6d060f44e2c5fbacad7254de759ecfd117ae1
|