We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e1312c commit 6ea4d8bCopy full SHA for 6ea4d8b
iShutdown_detect.py
@@ -6,16 +6,21 @@
6
import re
7
import tarfile
8
from datetime import datetime
9
-from termcolor import colored
10
11
12
def count_occurrences(content, target_phrase):
13
return content.count(target_phrase)
14
15
16
-def print_colored(text, color, blink=False):
17
- attrs = ['blink'] if blink else None
18
- print(colored(text, color, attrs=attrs))
+def print_colored(text, color):
+ if color == 'red':
+ print("\033[91m {}\033[00m" .format(text))
+ elif color == 'yellow':
19
+ print("\033[93m {}\033[00m" .format(text))
20
+ elif color == 'green':
21
+ print("\033[92m {}\033[00m" .format(text))
22
+ else:
23
+ print(text)
24
25
26
def find_anomalies_before_sigterm(content, anomaly_phrase, threshold=3):
0 commit comments