-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathColorPrint.py
More file actions
54 lines (38 loc) · 1.11 KB
/
ColorPrint.py
File metadata and controls
54 lines (38 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
# coding = utf-8
try:
from colorama import init, Fore
except ImportError:
print "[!_!]ERROR INFO: You have to install colorama module."
exit()
import logging
init(autoreset=True)
logger = logging.getLogger('')
logger.setLevel(logging.INFO)
file_handle = logging.FileHandler('GitLeak.log')
file_handle.setLevel(logging.INFO)
formatter = logging.Formatter('%(message)s')
file_handle.setFormatter(formatter)
logger.addHandler(file_handle)
def error_print(string):
# Print error information with red color
print Fore.RED + string
logger.error(string)
def info_print(string):
# Print information with green color
print Fore.GREEN + string
logger.info(string)
def project_print(string):
# Print project information with deep green color
print Fore.CYAN + string
logger.info(string)
def file_print(string):
# Print file url with yellow color
print Fore.YELLOW + string
logger.info(string)
def code_print(string):
# Print code line with white color
print Fore.WHITE + string
logger.info(string)
if __name__ == "__main__":
pass