Name | fw-logging JSON |
Version |
2.1.0
JSON |
| download |
home_page | None |
Summary | Logging helper library. |
upload_time | 2025-08-05 12:13:46 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
flywheel
helper
logging
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# fw-logging
Logging helper library for standard `logging` configuration, JSON formatting,
and for tailing (non-)structured logs re-formatted and colorized for humans.
## Installation
```bash
pip install fw-logging
```
## Usage
### logformat
Use the CLI utility `logformat` to re-format (Flywheel) logs for humans:
```bash
# pipe json and/or text logs directly
kubectl logs my-pod | logformat
# OR pass a filename containing the same
kubectl logs my-pod > my-pod.log
logformat my-pod.log
# OR pass a rich text file (.rtf) of logs
logformat my-pod-log.rtf
```
### Library
Use the `fw_logging` module to set up python `logging` in 2 lines:
```python
import fw_logging
fw_logging.setup_logging()
```
The default configuration sets up logging at level `INFO` to `stdout`, formatted
as `text` with colorized levels and caller information.
To emit structured JSON logs in production just override the formatter using an
environment variable: `FW_LOG_FORMATTER=json`.
Table of main config options and the corresponding envvars:
| Envvar | Default | Alternative / Example |
|:-------------------|:---------|:------------------------|
| `FW_LOG_LEVEL` | `INFO` | `DEBUG` |
| `FW_LOG_HANDLER` | `stdout` | `stderr` |
| `FW_LOG_FORMATTER` | `text` | `json` |
| `FW_LOG_LOGGERS` | | `{"pika":"ERROR"}` |
| `FW_LOG_FILTERS` | | `{"lgr":{"msg":"rgx"}}` |
## License
[](LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "fw-logging",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "Flywheel, helper, logging",
"author": null,
"author_email": "Flywheel <support@flywheel.io>",
"download_url": null,
"platform": null,
"description": "# fw-logging\n\nLogging helper library for standard `logging` configuration, JSON formatting,\nand for tailing (non-)structured logs re-formatted and colorized for humans.\n\n## Installation\n\n```bash\npip install fw-logging\n```\n\n## Usage\n\n### logformat\n\nUse the CLI utility `logformat` to re-format (Flywheel) logs for humans:\n\n```bash\n# pipe json and/or text logs directly\nkubectl logs my-pod | logformat\n# OR pass a filename containing the same\nkubectl logs my-pod > my-pod.log\nlogformat my-pod.log\n# OR pass a rich text file (.rtf) of logs\nlogformat my-pod-log.rtf\n```\n\n### Library\n\nUse the `fw_logging` module to set up python `logging` in 2 lines:\n\n```python\nimport fw_logging\nfw_logging.setup_logging()\n```\n\nThe default configuration sets up logging at level `INFO` to `stdout`, formatted\nas `text` with colorized levels and caller information.\n\nTo emit structured JSON logs in production just override the formatter using an\nenvironment variable: `FW_LOG_FORMATTER=json`.\n\nTable of main config options and the corresponding envvars:\n\n| Envvar | Default | Alternative / Example |\n|:-------------------|:---------|:------------------------|\n| `FW_LOG_LEVEL` | `INFO` | `DEBUG` |\n| `FW_LOG_HANDLER` | `stdout` | `stderr` |\n| `FW_LOG_FORMATTER` | `text` | `json` |\n| `FW_LOG_LOGGERS` | | `{\"pika\":\"ERROR\"}` |\n| `FW_LOG_FILTERS` | | `{\"lgr\":{\"msg\":\"rgx\"}}` |\n\n## License\n\n[](LICENSE)\n",
"bugtrack_url": null,
"license": null,
"summary": "Logging helper library.",
"version": "2.1.0",
"project_urls": {
"Repository": "https://gitlab.com/flywheel-io/tools/lib/fw-logging"
},
"split_keywords": [
"flywheel",
" helper",
" logging"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9792d8e3f906680752f69f3b0adbb2b8c6738785893733d71729e777854ef98c",
"md5": "614b9d372e931139793fea266c553443",
"sha256": "ce00e54e14694264042751aa76b17016631652a3d8ba20d757fbb46ce3d439e5"
},
"downloads": -1,
"filename": "fw_logging-2.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "614b9d372e931139793fea266c553443",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 9337,
"upload_time": "2025-08-05T12:13:46",
"upload_time_iso_8601": "2025-08-05T12:13:46.492609Z",
"url": "https://files.pythonhosted.org/packages/97/92/d8e3f906680752f69f3b0adbb2b8c6738785893733d71729e777854ef98c/fw_logging-2.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-05 12:13:46",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "flywheel-io",
"gitlab_project": "tools",
"lcname": "fw-logging"
}