1
0
Fork 0
mirror of https://github.com/imjasonh/terraform-playground synced 2026-07-06 23:12:22 +00:00

clean up logging

Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
Jason Hall 2026-02-05 21:55:20 -05:00
parent a57a90de12
commit 0983014992

View file

@ -6,8 +6,6 @@ import (
"flag"
"fmt"
"html/template"
"log"
"log/slog"
"net/http"
"os"
"time"
@ -29,6 +27,8 @@ func main() {
dbfile := *dbfile
dsn := dbfile
log := clog.FromContext(context.Background())
if metadata.OnGCE() {
replicaURL := os.Getenv("LITESTREAM_REPLICA_URL")
if replicaURL == "" {
@ -43,8 +43,7 @@ func main() {
clog.Fatalf("failed to init replica client: %v", err)
}
logger := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelInfo}))
vfs := litestream.NewVFS(client, logger)
vfs := litestream.NewVFS(client, &log.Logger)
vfs.PollInterval = 1 * time.Second
vfs.WriteEnabled = true
vfs.WriteSyncInterval = 1 * time.Second
@ -99,7 +98,7 @@ func main() {
clog.Fatalf("failed to execute template: %v", err)
}
})
log.Fatal(http.ListenAndServe(":8080", nil))
clog.Fatal("ListenAndServe", "err", http.ListenAndServe(":8080", nil))
}
func getData(db *sql.DB, getVersion bool) (data, error) {