@@ -46,7 +46,7 @@ func GetConfigs(ctx context.Context, opts *flag.Options, accessToken string) err
4646
4747 if opts .CloudOptions .SecretConfig && opts .Scanners .Enabled (types .SecretScanner ) {
4848 if opts .SecretOptions .SecretConfigPath != "" {
49- logger .Warn ("Secret config path already set" , log .String ( "configPath" , opts .SecretOptions .SecretConfigPath ))
49+ logger .Warn ("Secret config path already set" , log .FilePath ( opts .SecretOptions .SecretConfigPath ))
5050 return nil
5151 }
5252
@@ -64,7 +64,7 @@ func GetConfigs(ctx context.Context, opts *flag.Options, accessToken string) err
6464// getConfigFromTrivyCloud downloads a config from Trivy Cloud and saves it to a file
6565// it returns the path to the config file if it was downloaded successfully, otherwise it returns an error
6666func getConfigFromTrivyCloud (ctx context.Context , client * http.Client , opts * flag.Options , accessToken string , configType ConfigType ) (string , error ) {
67- logger := log .WithPrefix (log .PrefixCloud )
67+ logger := log .WithPrefix (log .PrefixCloud ). With ( "configType" , configType )
6868 configTypeStr := string (configType )
6969 configDir := filepath .Join (fsutils .TrivyHomeDir (), "cloud" , configTypeStr )
7070 if err := os .MkdirAll (configDir , os .ModePerm ); err != nil {
@@ -74,11 +74,11 @@ func getConfigFromTrivyCloud(ctx context.Context, client *http.Client, opts *fla
7474 configFilename := filepath .Join (configDir , "config.yaml" )
7575 // Return cached config if it was updated within the last hour
7676 if stat , err := os .Stat (configFilename ); err == nil && stat .ModTime ().After (time .Now ().Add (- configCacheTTL )) {
77- logger .Debug ("Config found in cache" , log .String ( "configType" , string ( configType )), log . String ( "configPath" , configFilename ))
77+ logger .Debug ("Config found in cache" , log .FilePath ( configFilename ))
7878 return configFilename , nil
7979 }
8080
81- logger .Debug ("Config not found in cache" , log .String ( "configType" , string ( configType )), log . String ( "configPath" , configFilename ))
81+ logger .Debug ("Config not found in cache" , log .FilePath ( configFilename ))
8282 configPath , ok := configPaths [configType ]
8383 if ! ok {
8484 return "" , xerrors .Errorf ("unknown config type: %s" , configType )
0 commit comments