@@ -34,9 +34,21 @@ def default_log_template(self, record):
3434
3535 tpl = ''
3636 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+ )
4052 tpl += Style .RESET_ALL
4153
4254 return tpl
@@ -56,7 +68,9 @@ def format(self, record):
5668 record .message = "Bad message (%r): %r" % (e , record .__dict__ )
5769
5870 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+ )
6074
6175 prefix = self .template (record ) % record .__dict__
6276
@@ -74,11 +88,29 @@ def debug_log_template(self, record):
7488
7589 tpl = ''
7690 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+ )
82114 tpl += Style .RESET_ALL
83115
84116 return tpl
0 commit comments