From 973fa31b6743a3ea84c86ab7671349cc70a69142 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 29 Jun 2024 21:27:35 +0200 Subject: enable filtered debug logging via DEBUG="component.*" --- cmd/build/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cmd/build') diff --git a/cmd/build/main.go b/cmd/build/main.go index 14175e9..39cbc1b 100644 --- a/cmd/build/main.go +++ b/cmd/build/main.go @@ -5,6 +5,7 @@ import ( "os" "go.alanpearce.eu/website/internal/builder" + "go.alanpearce.eu/website/internal/config" "go.alanpearce.eu/website/internal/log" "github.com/ardanlabs/conf/v3" @@ -20,7 +21,7 @@ func main() { } panic("error parsing configuration: " + err.Error()) } - log.Configure(!ioConfig.Development) + log := log.Configure(!ioConfig.Development) log.Debug("starting build process") if ioConfig.Source != "." { @@ -29,7 +30,12 @@ func main() { log.Panic("could not change to source directory") } } - _, err := builder.BuildSite(ioConfig, nil) + cfg, err := config.GetConfig(ioConfig.Source, log) + if err != nil { + log.Error("could not read config", "error", err) + } + + _, err = builder.BuildSite(ioConfig, cfg, log) if err != nil { log.Error("could not build site", "error", err) os.Exit(1) -- cgit 1.4.1