log tz message
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-23 17:02:15 +10:00
parent 06c7b0cc14
commit cc309152ec

View File

@@ -199,9 +199,6 @@ func main() {
end := flag.Duration("e", 0, "End time") end := flag.Duration("e", 0, "End time")
flag.Parse() flag.Parse()
// So we can convert vCenter UTC to our local timezone
location, _ = time.LoadLocation(*vTZ)
// Print logs to file // Print logs to file
f, err := os.OpenFile("log.txt", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) f, err := os.OpenFile("log.txt", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil { if err != nil {
@@ -212,6 +209,10 @@ func main() {
log.Printf("Starting execution. Built on %s from sha1 %s\n", buildTime, sha1ver) log.Printf("Starting execution. Built on %s from sha1 %s\n", buildTime, sha1ver)
// So we can convert vCenter UTC to our local timezone
log.Printf("Setting timezone to '%s'\n", *vTZ)
location, _ = time.LoadLocation(*vTZ)
u, err := url.Parse(*vURL) u, err := url.Parse(*vURL)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "Error parsing url %s : %s\n", *vURL, err) fmt.Fprintf(os.Stderr, "Error parsing url %s : %s\n", *vURL, err)