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:log2file"], 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.2.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

pipen_poplog-0.2.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_poplog-0.2.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1023-azure

File hashes

Hashes for pipen_poplog-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d1413240755ebfebeade5ea77c89b7aa1dd31f7099e293a4eb9f04cbbb10a4f4
MD5 1afbc35f7917b95e700f2899d5733a9a
BLAKE2b-256 29ad14fe41678f1f00549e5632b121460b03084ec992f2b965762d21c9032c65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipen_poplog-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1023-azure

File hashes

Hashes for pipen_poplog-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cdbf3a86eae24b08e48d9b543f280494349283f9d4c989487253923d46703e8
MD5 2983daa4a902ea97ef3a0cc970361f31
BLAKE2b-256 bdb4be9299d08cbfb1bc5e939bdd438da467b38afca447d1155780330a1858a4

See more details on using hashes here.

Supported by

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