File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
9
9
10
10
### Changed
11
11
12
+ - options can be set now with ` svd2rust.toml ` config
12
13
- option ` ignore_groups ` for optional disabling #506
13
14
- [ breaking-change] move ` const_generic ` from features to options
14
15
- use ` Config ` to pass options over all render levels
Original file line number Diff line number Diff line change @@ -85,8 +85,6 @@ fn run() -> Result<()> {
85
85
) )
86
86
. get_matches ( ) ;
87
87
88
- setup_logging ( & matches) ;
89
-
90
88
let xml = & mut String :: new ( ) ;
91
89
match matches. value_of ( "input" ) {
92
90
Some ( file) => {
@@ -110,6 +108,8 @@ fn run() -> Result<()> {
110
108
111
109
let cfg = with_toml_env ( & matches, & [ config_filename, "svd2rust.toml" ] ) ;
112
110
111
+ setup_logging ( & cfg) ;
112
+
113
113
let target = cfg
114
114
. grab ( )
115
115
. arg ( "target" )
@@ -155,7 +155,7 @@ fn run() -> Result<()> {
155
155
Ok ( ( ) )
156
156
}
157
157
158
- fn setup_logging ( matches : & clap :: ArgMatches ) {
158
+ fn setup_logging < ' a > ( getter : & ' a impl clap_conf :: Getter < ' a , String > ) {
159
159
// * Log at info by default.
160
160
// * Allow users the option of setting complex logging filters using
161
161
// env_logger's `RUST_LOG` environment variable.
@@ -170,7 +170,7 @@ fn setup_logging(matches: &clap::ArgMatches) {
170
170
if log_lvl_from_env {
171
171
log:: set_max_level ( log:: LevelFilter :: Trace ) ;
172
172
} else {
173
- let level = match matches . value_of ( "log_level" ) {
173
+ let level = match getter . grab ( ) . arg ( "log_level" ) . conf ( "log_level" ) . done ( ) {
174
174
Some ( lvl) => lvl. parse ( ) . unwrap ( ) ,
175
175
None => log:: LevelFilter :: Info ,
176
176
} ;
You can’t perform that action at this time.
0 commit comments