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
33
34
35
36
37
38
39
40
41
42
43
|
import colorama
import sys
import src.globalvars
def allocbench_msg(color, *objects, sep=' ', end='\n', file=sys.stdout, flush=False):
if src.globalvars.verbosity < 0:
return
color = getattr(colorama.Fore, color)
print(color, end="", file=file)
print(*objects, sep=sep, end=end, file=file)
print(colorama.Fore.RESET, end="", file=file, flush=flush)
def print_debug(*objects, sep=' ', end='\n', file=sys.stdout, flush=False):
if src.globalvars.verbosity < 99:
return
print(*objects, sep=sep, end=end, file=file, flush=flush)
def print_info(*objects, sep=' ', end='\n', file=sys.stdout, flush=False):
if src.globalvars.verbosity < 1:
return
print(*objects, sep=sep, end=end, file=file, flush=flush)
def print_info0(*objects, sep=' ', end='\n', file=sys.stdout, flush=False):
if src.globalvars.verbosity < 0:
return
print(*objects, sep=sep, end=end, file=file, flush=flush)
def print_info2(*objects, sep=' ', end='\n', file=sys.stdout, flush=False):
if src.globalvars.verbosity < 2:
return
print(*objects, sep=sep, end=end, file=file, flush=flush)
def print_status(*objects, sep=' ', end='\n', file=sys.stdout, flush=False):
allocbench_msg("GREEN", *objects, sep=sep, end=end, file=file, flush=flush)
def print_warn(*objects, sep=' ', end='\n', file=sys.stdout, flush=False):
if src.globalvars.verbosity < 1:
return
allocbench_msg("YELLOW", *objects, sep=sep, end=end, file=file, flush=flush)
def print_error(*objects, sep=' ', end='\n', file=sys.stderr, flush=False):
allocbench_msg("RED", *objects, sep=sep, end=end, file=file, flush=flush)
|