Skip to content

Commit

Permalink
adding flag to set logging level
Browse files Browse the repository at this point in the history
  • Loading branch information
techBeck03 committed Apr 19, 2023
1 parent 900075f commit 9dc38db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ nxos:
`-filename` - (required) the path to the configuration yaml file created previously

`-out` - (optional) the filename for the results report.

`-logging` - (optional) sets the logging level during script execution. Valid values are `info`, `debug`, or `trace`

### Entering a password

Expand Down
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1668,12 +1668,22 @@ func main() {
//* Read configuration file from supplied filename
config_file := flag.String("filename", "config.yaml", "yaml config filename")
output_file := flag.String("out", "nexus_cloud_readiness", "output filename")
logging_level := flag.String("logging", "info", "logging level")
flag.Parse()
config, err := readConf(*config_file)
if err != nil {
log.Fatal(err)
}

switch *logging_level {
case "debug":
log.SetLevel(log.DebugLevel)
break
case "trace":
log.SetLevel(log.TraceLevel)
break
}

//* Retrieve support matrix
log.Println("Loading matrix")
matrix, err := configuration.GetConfigurationMatrix()
Expand Down

0 comments on commit 9dc38db

Please sign in to comment.