File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,11 @@ formatters:
1616 line : lineno
1717 thread_name : threadName
1818handlers :
19- stderr :
19+ stdout :
2020 class : logging.StreamHandler
21- level : INFO
2221 formatter : json
2322 stream : ext://sys.stdout
2423loggers :
2524 root :
26- level : DEBUG
2725 handlers :
28- - stderr
29- - file
26+ - stdout
Original file line number Diff line number Diff line change 11import importlib .resources as ires
2- import json
32import logging .config
43import logging .handlers
54
5+ import yaml
6+
67from autointent .custom_types import LogLevel
78
89
9- def setup_logging (level : LogLevel ) -> None :
10- config_file = ires .files ("autointent._logging" ).joinpath ("config.json " )
10+ def setup_logging (level : LogLevel | str ) -> None :
11+ config_file = ires .files ("autointent._logging" ).joinpath ("config.yaml " )
1112 with config_file .open () as f_in :
12- config = json .load (f_in )
13+ config = yaml .safe_load (f_in )
14+
15+ level = LogLevel (level )
16+ config ["loggers" ]["root" ]["level" ] = level .value
1317
1418 logging .config .dictConfig (config )
15- logging .basicConfig (level = level .value )
You can’t perform that action at this time.
0 commit comments