Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cedric05/json-outer
https://github.com/cedric05/json-outer
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cedric05/json-outer
- Owner: cedric05
- Created: 2023-05-02T12:54:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-04T21:46:13.000Z (10 months ago)
- Last Synced: 2024-10-05T23:21:29.969Z (3 months ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json-outer
launches process from given arguments and prints stdout/stderr distinctively with timestamped
## example
file: sample.py
```python
#!/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
```json
{"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"}
```