File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818EscapeCodes = typing .Mapping [str , str ]
1919LogColors = typing .Mapping [str , str ]
2020SecondaryLogColors = typing .Mapping [str , LogColors ]
21+ if sys .version_info >= (3 , 8 ):
22+ _FormatStyle = typing .Literal ["%" , "{" , "$" ]
23+ else :
24+ _FormatStyle = str
2125
2226# The default colors to use for the debug levels
2327default_log_colors = {
@@ -60,7 +64,7 @@ def __init__(
6064 self ,
6165 fmt : typing .Optional [str ] = None ,
6266 datefmt : typing .Optional [str ] = None ,
63- style : str = "%" ,
67+ style : _FormatStyle = "%" ,
6468 log_colors : typing .Optional [LogColors ] = None ,
6569 reset : bool = True ,
6670 secondary_log_colors : typing .Optional [SecondaryLogColors ] = None ,
@@ -89,7 +93,7 @@ def __init__(
8993 - reset (bool):
9094 Implicitly append a color reset to all records unless False.
9195 - style ('%' or '{' or '$'):
92- The format style to use. (*No meaning prior to Python 3.2.*)
96+ The format style to use.
9397 - secondary_log_colors (dict):
9498 Map secondary ``log_color`` attributes. (*New in version 2.6.*)
9599 - validate (bool)
Original file line number Diff line number Diff line change 4343
4444
4545def basicConfig (
46- style : str = "%" ,
46+ style : colorlog . formatter . _FormatStyle = "%" ,
4747 log_colors : typing .Optional [colorlog .formatter .LogColors ] = None ,
4848 reset : bool = True ,
4949 secondary_log_colors : typing .Optional [colorlog .formatter .SecondaryLogColors ] = None ,
You can’t perform that action at this time.
0 commit comments