diff --git a/pkg/log/config.go b/pkg/log/config.go new file mode 100644 index 000000000..0bb4db1b5 --- /dev/null +++ b/pkg/log/config.go @@ -0,0 +1,14 @@ +package log + +import "github.com/opencloud-eu/opencloud/pkg/shared" + +// Configure initializes a service-specific logger instance. +func Configure(name string, commons *shared.Commons, localServiceLogLevel string) Logger { + return NewLogger( + Name(name), + Level(localServiceLogLevel), + Pretty(commons.Log.Pretty), + Color(commons.Log.Color), + File(commons.Log.File), + ) +} diff --git a/pkg/shared/logging.go b/pkg/shared/logging.go deleted file mode 100644 index b774b1884..000000000 --- a/pkg/shared/logging.go +++ /dev/null @@ -1,14 +0,0 @@ -package shared - -import "github.com/opencloud-eu/opencloud/pkg/log" - -// Configure initializes a service-specific logger instance. -func Configure(name string, commons *Commons, localServiceLogLevel string) log.Logger { - return log.NewLogger( - log.Name(name), - log.Level(localServiceLogLevel), - log.Pretty(commons.Log.Pretty), - log.Color(commons.Log.Color), - log.File(commons.Log.File), - ) -} diff --git a/services/activitylog/pkg/command/server.go b/services/activitylog/pkg/command/server.go index c7aed3e9b..8f95d481f 100644 --- a/services/activitylog/pkg/command/server.go +++ b/services/activitylog/pkg/command/server.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/oklog/run" - "github.com/opencloud-eu/opencloud/pkg/shared" + "github.com/opencloud-eu/opencloud/pkg/log" "github.com/opencloud-eu/reva/v2/pkg/events" "github.com/opencloud-eu/reva/v2/pkg/events/stream" "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool" @@ -55,7 +55,7 @@ func Server(cfg *config.Config) *cobra.Command { return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, RunE: func(cmd *cobra.Command, args []string) error { - logger := shared.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel) + logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel) tracerProvider, err := tracing.GetTraceProvider(cmd.Context(), cfg.Commons.TracesExporter, cfg.Service.Name) if err != nil { logger.Error().Err(err).Msg("Failed to initialize tracer")