File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ def get_method_case(method):
22
22
exit (1 )
23
23
24
24
def parse_line (line ):
25
- line = line .replace ('@sudo' , '$SUDO' )
25
+ line = line \
26
+ .replace ('@sudo' , '$SUDO' )\
27
+ .replace ('@log' , 'info' )\
28
+ .replace ('@info' , 'info' )\
29
+ .replace ('@warn' , 'warn' )\
30
+ .replace ('@error' , 'error' )
26
31
return line
27
32
28
33
def generate (path ):
@@ -60,6 +65,23 @@ def generate(path):
60
65
fi
61
66
fi
62
67
68
+ RESET='\033 [0m' # Red
69
+ RED='\033 [0;31m' # Red
70
+ GREEN='\033 [0;32m' # Green
71
+ YELLOW='\033 [0;33m' # Yellow
72
+ log () {
73
+ echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"
74
+ }
75
+ info () {
76
+ log "$GREEN INFO$RESET $1"
77
+ }
78
+ warn () {
79
+ log "$YELLOW WARN$RESET $1"
80
+ }
81
+ error () {
82
+ log "$RED ERROR$RESET $1"
83
+ }
84
+
63
85
""" )
64
86
65
87
seperator = "if"
You can’t perform that action at this time.
0 commit comments