From 01e8e79bfbee00eac7e2b295ff5590a05b3d7e05 Mon Sep 17 00:00:00 2001 From: Walid Baruni Date: Mon, 7 Oct 2024 15:09:22 +0200 Subject: [PATCH] set logging in repo setup --- pkg/setup/setup.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/setup/setup.go b/pkg/setup/setup.go index d270600bec..7c6d11e0fb 100644 --- a/pkg/setup/setup.go +++ b/pkg/setup/setup.go @@ -9,6 +9,7 @@ import ( "github.com/bacalhau-project/bacalhau/pkg/config" "github.com/bacalhau-project/bacalhau/pkg/config/types" + "github.com/bacalhau-project/bacalhau/pkg/logger" "github.com/bacalhau-project/bacalhau/pkg/repo/migrations" "github.com/bacalhau-project/bacalhau/pkg/repo" @@ -24,6 +25,9 @@ func SetupMigrationManager() (*repo.MigrationManager, error) { // SetupBacalhauRepo ensures that a bacalhau repo and config exist and are initialized. func SetupBacalhauRepo(cfg types.Bacalhau) (*repo.FsRepo, error) { + if err := logger.ParseAndConfigureLogging(cfg.Logging.Mode, cfg.Logging.Level); err != nil { + return nil, fmt.Errorf("failed to configure logging: %w", err) + } migrationManger, err := SetupMigrationManager() if err != nil { return nil, fmt.Errorf("failed to create migration manager: %w", err)