Skip to content

Commit

Permalink
move log flags up before serving plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
fairclothjm committed Nov 15, 2023
1 parent 7195175 commit 6125fee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func main() {
serveOpts = append(serveOpts, tf5server.WithManagedDebug())
}

// fix duplicate timestamp and incorrect level messages for legacy sdk v2
// https://developer.hashicorp.com/terraform/plugin/log/writing#legacy-log-troubleshooting
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))

err = tf5server.Serve(
"registry.terraform.io/hashicorp/vault",
muxServer.ProviderServer,
Expand All @@ -48,8 +52,4 @@ func main() {
if err != nil {
log.Fatal(err)
}

// fix duplicate timestamp and incorrect level messages for legacy sdk v2
// https://developer.hashicorp.com/terraform/plugin/log/writing#legacy-log-troubleshooting
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))
}

0 comments on commit 6125fee

Please sign in to comment.