json-outer

Crates.iojson-outer
lib.rsjson-outer
version0.1.0
sourcesrc
created_at2023-05-05 07:54:26.754353
updated_at2023-05-05 07:54:26.754353
descriptionsplits tail output into multiple files
homepage
repository
max_upload_size
id857428
size20,575
Prasanth (cedric05)

documentation

README

json-outer

launches process from given arguments and prints stdout/stderr distinctively with timestamped

example

file: sample.py

#!/usr/bin/env python3
import time
import sys
a = 0
while True:
    a += 1
    time.sleep(1)
    if a % 2 == 0:
        print(f'line {a}', flush=True, file=sys.stdout)
    else:
        print(f'line {a}', flush=True, file=sys.stderr)
    if a % 10 == 0:
        inprovided = input("please give me some input")
        print(f"input provided: {inprovided}")

cargo run python3 sample.py

Example stdout

{"log":"line 2","stream":"stdout","time":"2023-05-02T18:00:38.526892071+05:30"}
{"log":"line 2","stream":"stdout","time":"2023-05-02T18:00:38.526892071+05:30"}
Commit count: 0

cargo fmt