Skip to main content

Populate logs from jobs to running log of the pipeline

Project description

pipen-poplog

Populate logs from jobs to running log of the pipeline for pipen.

Installation

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipen_poplog-0.3.9.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipen_poplog-0.3.9-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pipen_poplog-0.3.9.tar.gz.

File metadata

  • Download URL: pipen_poplog-0.3.9.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for pipen_poplog-0.3.9.tar.gz
Algorithm Hash digest
SHA256 7f5884a28ff58a54f1a41eb06d72d0086bcec9e159fadaf1262a481e8dd857c5
MD5 21d0bf58c697591d684770645c47a7b6
BLAKE2b-256 93f0f7508cac9d45afba33eac5572c01681da6ad8cabeb8d35e7ef6a2857ce37

See more details on using hashes here.

File details

Details for the file pipen_poplog-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: pipen_poplog-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for pipen_poplog-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7cc10316b1e6587029383dfbfc82150c1b1d4619c754c2bba0388308490faa2a
MD5 6fb5c5c15053a0458c5cdb3e9ab9d929
BLAKE2b-256 cb8a019f3b05ef9c15308a5587b1ed7b8984ea168881f817b8f1313bcf5c4da6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page