# pipen-poplog
Populate logs from jobs to running log of the pipeline for [pipen][1].
## Installation
```bash
pip install -U pipen-poplog
```
## Enabling/Disabling the plugin
The plugin is registered via entrypoints. It's by default enabled. To disable it:
`plugins=[..., "no:poplog"]`, or uninstall this plugin.
## Usage
```python
from pipen import Proc, Pipen
class Poplog(Proc):
input = "var:var"
input_data = [0, 1, 2]
script = """
echo -n "[PIPEN-POPLOG][INFO] Log message "
sleep 1 # Simulate message not read in time
echo "by {{in.var}} 1"
sleep 1
echo "[PIPEN-POPLOG][ERROR] Log message by {{in.var}} 2"
sleep 1
echo "[PIPEN-POPLOG][INFO] Log message by {{in.var}} 3"
"""
if __name__ == "__main__":
Pipen().run()
```
```
01-12 11:23:52 I core ╭═══════════════ PoplogDefault ═════════════════╮
01-12 11:23:52 I core ║ A default poplog proc ║
01-12 11:23:52 I core ╰═══════════════════════════════════════════════╯
01-12 11:23:52 I core PoplogDefault: Workdir: '.pipen/Pipeline/PoplogDefault'
01-12 11:23:52 I core PoplogDefault: <<< [START]
01-12 11:23:52 I core PoplogDefault: >>> [END]
01-12 11:23:56 I poplog PoplogDefault: [0/2] Log message by 0 1
01-12 11:23:59 E poplog PoplogDefault: [0/2] Log message by 0 2
01-12 11:24:02 I poplog PoplogDefault: [0/2] Log message by 0 3
```
## Configuration
- `plugin_opts.poplog_loglevel`: The log level for poplog. Default: `info`.
- `plugin_opts.poplog_pattern`: The pattern to match the log message. Default: `r'\[PIPEN-POPLOG\]\[(?P<level>\w+)\] (?P<message>.*)'`.
- `plugin_opts.poplog_jobs`: The job indices to be populated. Default: `[0]` (the first job).
- `plugin_opts.poplog_max`: The total max number of the log message to be poplutated. Default: `99`.
- `plugin_opts.poplog_source`: The source of the log message. Default: `stdout`.
[1]: https://github.com/pwwang/pipen
Raw data
{
"_id": null,
"home_page": "https://github.com/pwwang/pipen-poplog",
"name": "pipen-poplog",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "pwwang",
"author_email": "pwwang@pwwang.com",
"download_url": "https://files.pythonhosted.org/packages/6a/4c/312a9f1f44c021008c03d51d65d4020a60187d63623e50ab0d7efa6828aa/pipen_poplog-0.3.7.tar.gz",
"platform": null,
"description": "# pipen-poplog\n\nPopulate logs from jobs to running log of the pipeline for [pipen][1].\n\n## Installation\n\n```bash\npip install -U pipen-poplog\n```\n\n## Enabling/Disabling the plugin\n\nThe plugin is registered via entrypoints. It's by default enabled. To disable it:\n`plugins=[..., \"no:poplog\"]`, or uninstall this plugin.\n\n## Usage\n\n```python\nfrom pipen import Proc, Pipen\n\n\nclass Poplog(Proc):\n input = \"var:var\"\n input_data = [0, 1, 2]\n script = \"\"\"\n echo -n \"[PIPEN-POPLOG][INFO] Log message \"\n sleep 1 # Simulate message not read in time\n echo \"by {{in.var}} 1\"\n sleep 1\n echo \"[PIPEN-POPLOG][ERROR] Log message by {{in.var}} 2\"\n sleep 1\n echo \"[PIPEN-POPLOG][INFO] Log message by {{in.var}} 3\"\n \"\"\"\n\n\nif __name__ == \"__main__\":\n Pipen().run()\n```\n\n```\n01-12 11:23:52 I core \u256d\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 PoplogDefault \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256e\n01-12 11:23:52 I core \u2551 A default poplog proc \u2551\n01-12 11:23:52 I core \u2570\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256f\n01-12 11:23:52 I core PoplogDefault: Workdir: '.pipen/Pipeline/PoplogDefault'\n01-12 11:23:52 I core PoplogDefault: <<< [START]\n01-12 11:23:52 I core PoplogDefault: >>> [END]\n01-12 11:23:56 I poplog PoplogDefault: [0/2] Log message by 0 1\n01-12 11:23:59 E poplog PoplogDefault: [0/2] Log message by 0 2\n01-12 11:24:02 I poplog PoplogDefault: [0/2] Log message by 0 3\n```\n\n## Configuration\n\n- `plugin_opts.poplog_loglevel`: The log level for poplog. Default: `info`.\n- `plugin_opts.poplog_pattern`: The pattern to match the log message. Default: `r'\\[PIPEN-POPLOG\\]\\[(?P<level>\\w+)\\] (?P<message>.*)'`.\n- `plugin_opts.poplog_jobs`: The job indices to be populated. Default: `[0]` (the first job).\n- `plugin_opts.poplog_max`: The total max number of the log message to be poplutated. Default: `99`.\n- `plugin_opts.poplog_source`: The source of the log message. Default: `stdout`.\n\n\n[1]: https://github.com/pwwang/pipen\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Populate logs from jobs to running log of the pipeline",
"version": "0.3.7",
"project_urls": {
"Homepage": "https://github.com/pwwang/pipen-poplog",
"Repository": "https://github.com/pwwang/pipen-poplog"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5954d3238861673d11ddc28f3b40cf877e78383832100490e9b3e8174bb85392",
"md5": "a83047d361933ecdca6ea873a661b24a",
"sha256": "477b14b06eb6ed00519cc72c0eb6d538dc5e69ddeec00f63d14e30cf423566ff"
},
"downloads": -1,
"filename": "pipen_poplog-0.3.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a83047d361933ecdca6ea873a661b24a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 5593,
"upload_time": "2025-08-31T08:11:41",
"upload_time_iso_8601": "2025-08-31T08:11:41.626085Z",
"url": "https://files.pythonhosted.org/packages/59/54/d3238861673d11ddc28f3b40cf877e78383832100490e9b3e8174bb85392/pipen_poplog-0.3.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6a4c312a9f1f44c021008c03d51d65d4020a60187d63623e50ab0d7efa6828aa",
"md5": "ff4d6d109dd80a8ba4c16c7c06347159",
"sha256": "8eff3cef2cd9d05e64421d73ddb7094129b5dd1e641c2a2fc969b6dff47eb747"
},
"downloads": -1,
"filename": "pipen_poplog-0.3.7.tar.gz",
"has_sig": false,
"md5_digest": "ff4d6d109dd80a8ba4c16c7c06347159",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 5548,
"upload_time": "2025-08-31T08:11:42",
"upload_time_iso_8601": "2025-08-31T08:11:42.950880Z",
"url": "https://files.pythonhosted.org/packages/6a/4c/312a9f1f44c021008c03d51d65d4020a60187d63623e50ab0d7efa6828aa/pipen_poplog-0.3.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 08:11:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pwwang",
"github_project": "pipen-poplog",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pipen-poplog"
}