forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
colored-logs.yaml
32 lines (31 loc) · 876 Bytes
/
colored-logs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# This example demonstrates colored logs of the logs viewer on Argo UI.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: colored-logs-
spec:
entrypoint: whalesay
templates:
- name: whalesay
script:
image: python:3.7
command: ["python"]
source: |
import time
import random
messages = [
'No Color',
'\x1b[30m%s\x1b[0m' % 'FG Black',
'\x1b[32m%s\x1b[0m' % 'FG Green',
'\x1b[34m%s\x1b[0m' % 'FG Blue',
'\x1b[36m%s\x1b[0m' % 'FG Cyan',
'\x1b[41m%s\x1b[0m' % 'BG Red',
'\x1b[43m%s\x1b[0m' % 'BG Yellow',
'\x1b[45m%s\x1b[0m' % 'BG Magenta',
]
for i in range(1, 100):
print(random.choice(messages))
time.sleep(1)
env:
- name: PYTHONUNBUFFERED
value: '1'