@@ -16,7 +16,7 @@ use filetime::FileTime;
16
16
use gix:: bstr:: { BString , ByteVec } ;
17
17
use gix:: dir:: entry:: Status ;
18
18
use ignore:: gitignore:: GitignoreBuilder ;
19
- use tracing:: { trace, warn} ;
19
+ use tracing:: { debug , trace, warn} ;
20
20
use walkdir:: WalkDir ;
21
21
22
22
/// A source represents one or multiple packages gathering from a given root
@@ -244,11 +244,9 @@ impl<'gctx> PathSource<'gctx> {
244
244
let repo_relative_path = match paths:: strip_prefix_canonical ( root, repo_root) {
245
245
Ok ( p) => p,
246
246
Err ( e) => {
247
- tracing :: warn!(
247
+ warn ! (
248
248
"cannot determine if path `{:?}` is in git repo `{:?}`: {:?}" ,
249
- root,
250
- repo_root,
251
- e
249
+ root, repo_root, e
252
250
) ;
253
251
return Ok ( None ) ;
254
252
}
@@ -288,11 +286,9 @@ impl<'gctx> PathSource<'gctx> {
288
286
let repo_relative_path = match paths:: strip_prefix_canonical ( root, repo_root) {
289
287
Ok ( p) => p,
290
288
Err ( e) => {
291
- tracing :: warn!(
289
+ warn ! (
292
290
"cannot determine if path `{:?}` is in git repo `{:?}`: {:?}" ,
293
- root,
294
- repo_root,
295
- e
291
+ root, repo_root, e
296
292
) ;
297
293
return Ok ( None ) ;
298
294
}
@@ -319,7 +315,7 @@ impl<'gctx> PathSource<'gctx> {
319
315
repo : & git2:: Repository ,
320
316
filter : & dyn Fn ( & Path , bool ) -> bool ,
321
317
) -> CargoResult < Vec < PathBuf > > {
322
- warn ! ( "list_files_git {}" , pkg. package_id( ) ) ;
318
+ debug ! ( "list_files_git {}" , pkg. package_id( ) ) ;
323
319
let index = repo. index ( ) ?;
324
320
let root = repo
325
321
. workdir ( )
@@ -407,7 +403,7 @@ impl<'gctx> PathSource<'gctx> {
407
403
Some ( "Cargo.toml" ) => {
408
404
let path = file_path. parent ( ) . unwrap ( ) ;
409
405
if path != pkg_path {
410
- warn ! ( "subpackage found: {}" , path. display( ) ) ;
406
+ debug ! ( "subpackage found: {}" , path. display( ) ) ;
411
407
ret. retain ( |p| !p. starts_with ( path) ) ;
412
408
subpackages_found. push ( path. to_path_buf ( ) ) ;
413
409
continue ;
@@ -427,7 +423,7 @@ impl<'gctx> PathSource<'gctx> {
427
423
// symlink points to a directory.
428
424
let is_dir = is_dir. unwrap_or_else ( || file_path. is_dir ( ) ) ;
429
425
if is_dir {
430
- warn ! ( " found directory {}" , file_path. display( ) ) ;
426
+ trace ! ( " found directory {}" , file_path. display( ) ) ;
431
427
match git2:: Repository :: open ( & file_path) {
432
428
Ok ( repo) => {
433
429
let files = self . list_files_git ( pkg, & repo, filter) ?;
@@ -440,7 +436,7 @@ impl<'gctx> PathSource<'gctx> {
440
436
} else if filter ( & file_path, is_dir) {
441
437
assert ! ( !is_dir) ;
442
438
// We found a file!
443
- warn ! ( " found {}" , file_path. display( ) ) ;
439
+ trace ! ( " found {}" , file_path. display( ) ) ;
444
440
ret. push ( file_path) ;
445
441
}
446
442
}
@@ -478,7 +474,7 @@ impl<'gctx> PathSource<'gctx> {
478
474
repo : & gix:: Repository ,
479
475
filter : & dyn Fn ( & Path , bool ) -> bool ,
480
476
) -> CargoResult < Vec < PathBuf > > {
481
- warn ! ( "list_files_gix {}" , pkg. package_id( ) ) ;
477
+ debug ! ( "list_files_gix {}" , pkg. package_id( ) ) ;
482
478
let options = repo
483
479
. dirwalk_options ( ) ?
484
480
. emit_untracked ( gix:: dir:: walk:: EmissionMode :: Matching )
@@ -559,7 +555,7 @@ impl<'gctx> PathSource<'gctx> {
559
555
// our own `Cargo.toml`, we keep going.
560
556
let path = file_path. parent ( ) . unwrap ( ) ;
561
557
if path != pkg_path {
562
- warn ! ( "subpackage found: {}" , path. display( ) ) ;
558
+ debug ! ( "subpackage found: {}" , path. display( ) ) ;
563
559
files. retain ( |p| !p. starts_with ( path) ) ;
564
560
subpackages_found. push ( path. to_path_buf ( ) ) ;
565
561
continue ;
@@ -595,7 +591,7 @@ impl<'gctx> PathSource<'gctx> {
595
591
}
596
592
} else if ( filter) ( & file_path, is_dir) {
597
593
assert ! ( !is_dir) ;
598
- warn ! ( " found {}" , file_path. display( ) ) ;
594
+ trace ! ( " found {}" , file_path. display( ) ) ;
599
595
files. push ( file_path) ;
600
596
}
601
597
}
0 commit comments