@@ -34,9 +34,21 @@ def default_log_template(self, record):
34
34
35
35
tpl = ''
36
36
tpl += Style .RESET_ALL
37
- tpl += LEVEL_COLORS .get (record .levelname ) + Style .BRIGHT + '(%(levelname)s)' + Style .RESET_ALL + ' '
38
- tpl += '[' + Fore .BLACK + Style .DIM + Style .BRIGHT + '%(asctime)s' + Fore .RESET + Style .RESET_ALL + ']'
39
- tpl += ' ' + Fore .WHITE + Style .DIM + Style .BRIGHT + '%(name)s' + Fore .RESET + Style .RESET_ALL + ' '
37
+ tpl += (
38
+ LEVEL_COLORS .get (record .levelname ) + Style .BRIGHT +
39
+ '(%(levelname)s)'
40
+ + Style .RESET_ALL + ' '
41
+ )
42
+ tpl += (
43
+ '[' + Fore .BLACK + Style .DIM + Style .BRIGHT +
44
+ '%(asctime)s'
45
+ + Fore .RESET + Style .RESET_ALL + ']'
46
+ )
47
+ tpl += (
48
+ ' ' + Fore .WHITE + Style .DIM + Style .BRIGHT +
49
+ '%(name)s'
50
+ + Fore .RESET + Style .RESET_ALL + ' '
51
+ )
40
52
tpl += Style .RESET_ALL
41
53
42
54
return tpl
@@ -56,7 +68,9 @@ def format(self, record):
56
68
record .message = "Bad message (%r): %r" % (e , record .__dict__ )
57
69
58
70
date_format = '%H:%m:%S'
59
- record .asctime = time .strftime (date_format , self .converter (record .created ))
71
+ record .asctime = time .strftime (
72
+ date_format , self .converter (record .created )
73
+ )
60
74
61
75
prefix = self .template (record ) % record .__dict__
62
76
@@ -74,11 +88,29 @@ def debug_log_template(self, record):
74
88
75
89
tpl = ''
76
90
tpl += Style .RESET_ALL
77
- tpl += LEVEL_COLORS .get (record .levelname ) + Style .BRIGHT + '(%(levelname)1.1s)' + Style .RESET_ALL + ' '
78
- tpl += '[' + Fore .BLACK + Style .DIM + Style .BRIGHT + '%(asctime)s' + Fore .RESET + Style .RESET_ALL + ']'
79
- tpl += ' ' + Fore .WHITE + Style .DIM + Style .BRIGHT + '%(name)s' + Fore .RESET + Style .RESET_ALL + ' '
80
- tpl += Fore .GREEN + Style .BRIGHT + '%(module)s.%(funcName)s()'
81
- tpl += Fore .BLACK + Style .DIM + Style .BRIGHT + ':' + Style .RESET_ALL + Fore .CYAN + '%(lineno)d'
91
+ tpl += (
92
+ LEVEL_COLORS .get (record .levelname ) + Style .BRIGHT +
93
+ '(%(levelname)1.1s)'
94
+ + Style .RESET_ALL + ' '
95
+ )
96
+ tpl += (
97
+ '[' + Fore .BLACK + Style .DIM + Style .BRIGHT +
98
+ '%(asctime)s'
99
+ + Fore .RESET + Style .RESET_ALL + ']'
100
+ )
101
+ tpl += (
102
+ ' ' + Fore .WHITE + Style .DIM + Style .BRIGHT +
103
+ '%(name)s'
104
+ + Fore .RESET + Style .RESET_ALL + ' '
105
+ )
106
+ tpl += (
107
+ Fore .GREEN + Style .BRIGHT +
108
+ '%(module)s.%(funcName)s()'
109
+ )
110
+ tpl += (
111
+ Fore .BLACK + Style .DIM + Style .BRIGHT + ':' + Style .RESET_ALL +
112
+ Fore .CYAN + '%(lineno)d'
113
+ )
82
114
tpl += Style .RESET_ALL
83
115
84
116
return tpl
0 commit comments