adding verbose init messages

This commit is contained in:
Hyatt 2022-01-10 09:07:03 -06:00
parent 8f477a0c79
commit ac105cbf0d
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA
2 changed files with 10 additions and 1 deletions

View File

@ -201,8 +201,9 @@ func tmpltTPlinkPost(w http.ResponseWriter, r *http.Request) {
err := json.NewDecoder(r.Body).Decode(&payload)
if err != nil {
log.Printf("[INFO] Unable to parse payload from API call: %v\n", err)
log.Printf("[INFO] Data received: %#v\n", payload)
tmpltError(w, http.StatusInternalServerError, fmt.Sprintf("Unable to read info from device: %v\n", err))
return
}
log.Printf("[TRACE] Data received: %#v\n", payload)
}

View File

@ -92,5 +92,13 @@ func initialize() {
setLogLevel(config.LogLevel)
log.SetOutput(config.Log)
// print current configuration
log.Printf("[DEBUG] configuration value set: LOG_LEVEL = %v\n", strconv.Itoa(config.LogLevel))
log.Printf("[DEBUG] configuration value set: HTTP_PORT = %v\n", strconv.Itoa(config.WebSrvPort))
log.Printf("[DEBUG] configuration value set: HTTP_IP = %v\n", config.WebSrvIP)
log.Printf("[DEBUG] configuration value set: HTTP_IDLE_TIMEOUT = %v\n", strconv.Itoa(config.WebSrvIdleTimeout))
log.Printf("[DEBUG] configuration value set: HTTP_READ_TIMEOUT = %v\n", strconv.Itoa(config.WebSrvReadTimeout))
log.Printf("[DEBUG] configuration value set: HTTP_WRITE_TIMEOUT = %v\n", strconv.Itoa(config.WebSrvWriteTimeout))
log.Printf("[DEBUG] Initialization complete.")
}