@@ -25,7 +25,7 @@ use k8s_openapi::{
2525use kube:: { Resource , ResourceExt } ;
2626use serde:: { Serialize , de:: DeserializeOwned } ;
2727use snafu:: { OptionExt , ResultExt , Snafu } ;
28- use tracing:: { debug, info , warn} ;
28+ use tracing:: { debug, warn} ;
2929
3030use crate :: {
3131 client:: { Client , GetApi } ,
@@ -714,9 +714,9 @@ impl<'a> ClusterResources<'a> {
714714 client : & Client ,
715715 ) -> Result < ( ) > {
716716 if !self . apply_strategy . delete_orphans ( ) {
717- debug ! (
718- "Skip deleting orphaned resources because of [{}] strategy." ,
719- self . apply_strategy
717+ tracing :: debug!(
718+ apply_strategy = ? self . apply_strategy ,
719+ "skip deleting orphaned resources because of strategy." ,
720720 ) ;
721721 return Ok ( ( ) ) ;
722722 }
@@ -726,10 +726,9 @@ impl<'a> ClusterResources<'a> {
726726 . await
727727 . context ( ListClusterResourcesSnafu ) ?
728728 {
729- debug ! (
730- "Skipping deletion of orphaned {} because the operator is not allowed to list \
731- them and is therefore probably not in charge of them.",
732- T :: plural( & ( ) )
729+ tracing:: debug!(
730+ type_name = std:: any:: type_name:: <T >( ) ,
731+ "skipping deletion of orphans of this type because the operator is not allowed to list them" ,
733732 ) ;
734733 return Ok ( ( ) ) ;
735734 }
@@ -751,10 +750,10 @@ impl<'a> ClusterResources<'a> {
751750 }
752751
753752 if !orphaned_resources. is_empty ( ) {
754- info ! (
755- "Deleting orphaned {}: {}" ,
756- T :: plural ( & ( ) ) ,
757- ClusterResources :: print_resources ( & orphaned_resources ) ,
753+ tracing :: info!(
754+ type_name = std :: any :: type_name :: < T > ( ) ,
755+ orphans = ClusterResources :: print_resources ( & orphaned_resources ) ,
756+ "deleting orphans" ,
758757 ) ;
759758 for resource in orphaned_resources. iter ( ) {
760759 client
0 commit comments