@@ -12,6 +12,7 @@ use dfx_core::network::provider::get_network_context;
12
12
use dfx_core:: util;
13
13
use fn_error_context:: context;
14
14
use handlebars:: Handlebars ;
15
+ use slog:: { trace, Logger } ;
15
16
use std:: borrow:: Cow ;
16
17
use std:: collections:: BTreeMap ;
17
18
use std:: ffi:: OsStr ;
@@ -94,6 +95,7 @@ pub trait CanisterBuilder {
94
95
/// Generate type declarations for the canister
95
96
fn generate (
96
97
& self ,
98
+ logger : & Logger ,
97
99
pool : & CanisterPool ,
98
100
info : & CanisterInfo ,
99
101
config : & BuildConfig ,
@@ -137,8 +139,9 @@ pub trait CanisterBuilder {
137
139
return Ok ( ( ) ) ;
138
140
}
139
141
140
- eprintln ! (
141
- "Generating type declarations for canister {}:" ,
142
+ trace ! (
143
+ logger,
144
+ "Generating type declarations for canister {}" ,
142
145
& info. get_name( )
143
146
) ;
144
147
@@ -172,7 +175,7 @@ pub trait CanisterBuilder {
172
175
output_did_ts_path. to_string_lossy( )
173
176
)
174
177
} ) ?;
175
- eprintln ! ( " {}" , & output_did_ts_path. display( ) ) ;
178
+ trace ! ( logger , " {}" , & output_did_ts_path. display( ) ) ;
176
179
177
180
compile_handlebars_files ( "ts" , info, generate_output_dir) ?;
178
181
}
@@ -191,7 +194,7 @@ pub trait CanisterBuilder {
191
194
output_did_js_path. to_string_lossy( )
192
195
)
193
196
} ) ?;
194
- eprintln ! ( " {}" , & output_did_js_path. display( ) ) ;
197
+ trace ! ( logger , " {}" , & output_did_js_path. display( ) ) ;
195
198
196
199
compile_handlebars_files ( "js" , info, generate_output_dir) ?;
197
200
}
@@ -206,7 +209,7 @@ pub trait CanisterBuilder {
206
209
std:: fs:: write ( & output_mo_path, content) . with_context ( || {
207
210
format ! ( "Failed to write to {}." , output_mo_path. to_string_lossy( ) )
208
211
} ) ?;
209
- eprintln ! ( " {}" , & output_mo_path. display( ) ) ;
212
+ trace ! ( logger , " {}" , & output_mo_path. display( ) ) ;
210
213
}
211
214
212
215
// Candid
@@ -216,7 +219,7 @@ pub trait CanisterBuilder {
216
219
. with_extension ( "did" ) ;
217
220
dfx_core:: fs:: copy ( & did_from_build, & output_did_path) ?;
218
221
dfx_core:: fs:: set_permissions_readwrite ( & output_did_path) ?;
219
- eprintln ! ( " {}" , & output_did_path. display( ) ) ;
222
+ trace ! ( logger , " {}" , & output_did_path. display( ) ) ;
220
223
}
221
224
222
225
Ok ( ( ) )
0 commit comments