diff --git a/cmd/main.go b/cmd/main.go index 0a8962a16..5688a22e1 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -33,15 +33,15 @@ func main() { } func handleCLI(args []string) error { - exec_name := filepath.Base(args[0]) + execName := filepath.Base(args[0]) // Take care of our Windows users - exec_name = strings.TrimSuffix(exec_name, ".exe") + execName = strings.TrimSuffix(execName, ".exe") // Being case-insensitive - exec_name = strings.ToLower(exec_name) + execName = strings.ToLower(execName) - if exec_name == "stash_plugin" || exec_name == "osdf_plugin" || exec_name == "pelican_xfer_plugin" { + if execName == "stash_plugin" || execName == "osdf_plugin" || execName == "pelican_xfer_plugin" { stashPluginMain(args[1:]) - } else if exec_name == "stashcp" { + } else if execName == "stashcp" { err := copyCmd.Execute() if err != nil { return err diff --git a/config/config.go b/config/config.go index b693ee4f0..143d2e3c0 100644 --- a/config/config.go +++ b/config/config.go @@ -336,7 +336,12 @@ func InitConfig() { if param.Debug.GetBool() { SetLogging(log.DebugLevel) } else { - SetLogging(log.ErrorLevel) + logLevel := param.Logging_Level.GetString() + level, err := log.ParseLevel(logLevel) + if err != nil { + cobra.CheckErr(err) + } + SetLogging(level) } } diff --git a/config/resources/defaults.yaml b/config/resources/defaults.yaml index a091c4af6..3c62688c3 100644 --- a/config/resources/defaults.yaml +++ b/config/resources/defaults.yaml @@ -15,7 +15,8 @@ # Debug: false - +Logging: + Level: "Error" Server: Port: 8444 Address: "0.0.0.0" diff --git a/docs/parameters.yaml b/docs/parameters.yaml index 9a2a19366..3e2758eea 100644 --- a/docs/parameters.yaml +++ b/docs/parameters.yaml @@ -103,6 +103,17 @@ default: 10s components: ["client", "nsregistry", "origin"] --- +############################ +# Log-Level Configs # +############################ +name: Logging.Level +description: >- + A string defining the log level of the client. Options include (going from most info to least): Trace, Debug, Info, Warn, Error, Fatal, Panic. +type: string +default: Error +components: ["*"] +--- + ############################ # Federation-Level Configs # ############################