File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -32,24 +32,24 @@ def default_log_template(self, record):
3232
3333 """
3434
35- tpl = ''
36- tpl += Style .RESET_ALL
37- tpl += (
35+ reset = Style .RESET_ALL
36+ levelname = (
3837 LEVEL_COLORS .get (record .levelname ) + Style .BRIGHT +
3938 '(%(levelname)s)'
4039 + Style .RESET_ALL + ' '
4140 )
42- tpl + = (
41+ asctime = (
4342 '[' + Fore .BLACK + Style .DIM + Style .BRIGHT +
4443 '%(asctime)s'
4544 + Fore .RESET + Style .RESET_ALL + ']'
4645 )
47- tpl + = (
46+ name = (
4847 ' ' + Fore .WHITE + Style .DIM + Style .BRIGHT +
4948 '%(name)s'
5049 + Fore .RESET + Style .RESET_ALL + ' '
5150 )
52- tpl += Style .RESET_ALL
51+
52+ tpl = reset + levelname + asctime + name + reset
5353
5454 return tpl
5555
@@ -86,32 +86,32 @@ def debug_log_template(self, record):
8686
8787 """
8888
89- tpl = ''
90- tpl += Style .RESET_ALL
91- tpl += (
89+ reset = Style .RESET_ALL
90+ levelname = (
9291 LEVEL_COLORS .get (record .levelname ) + Style .BRIGHT +
9392 '(%(levelname)1.1s)'
9493 + Style .RESET_ALL + ' '
9594 )
96- tpl + = (
95+ asctime = (
9796 '[' + Fore .BLACK + Style .DIM + Style .BRIGHT +
9897 '%(asctime)s'
9998 + Fore .RESET + Style .RESET_ALL + ']'
10099 )
101- tpl + = (
100+ name = (
102101 ' ' + Fore .WHITE + Style .DIM + Style .BRIGHT +
103102 '%(name)s'
104103 + Fore .RESET + Style .RESET_ALL + ' '
105104 )
106- tpl + = (
105+ module_funcName = (
107106 Fore .GREEN + Style .BRIGHT +
108107 '%(module)s.%(funcName)s()'
109108 )
110- tpl + = (
109+ lineno = (
111110 Fore .BLACK + Style .DIM + Style .BRIGHT + ':' + Style .RESET_ALL +
112111 Fore .CYAN + '%(lineno)d'
113112 )
114- tpl += Style .RESET_ALL
113+
114+ tpl = reset + levelname + asctime + name + module_funcName + lineno + reset
115115
116116 return tpl
117117
You can’t perform that action at this time.
0 commit comments