-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPrescientLogger.py
More file actions
36 lines (27 loc) · 1.11 KB
/
PrescientLogger.py
File metadata and controls
36 lines (27 loc) · 1.11 KB
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
'''
_______ _______ _______ _______ ________ ___ _______ __ __ ___________
/ __ / / ___ \ / ____/ / _____/ / ______\ / / / ____/ / \ / / /____ _____/
/ /__/ / / |__| | / /___ / /____ / / / / / /___ / \ / / / /
/ ______/ / __ ___/ / ____/ /______ / / / / / / ____/ / /\ \/ / / /
/ / / / \ \ / /____ _______/ / / /_____ / / / /___ / / \ / / /
/_/ /_/ \_\ /______/ /________/ /________/ /__/ /______/ /__/ \__/ /__/
Created by Mutlu Polatcan
01.02.2018
'''
import threading
from colorama import Style, init, deinit
semaphore = threading.BoundedSemaphore(value=1)
class PrescientLogger:
def __init__(self):
pass
@staticmethod
def console_log(owner, color, *logs):
semaphore.acquire()
init()
for log in logs:
if owner:
print(Style.BRIGHT + color + "[" + owner + "] -> " + log + "\n" + Style.RESET_ALL)
else:
print(Style.BRIGHT + color + log + Style.RESET_ALL)
deinit()
semaphore.release()