diff --git a/pkg/trace/resolver.go b/pkg/trace/resolver.go new file mode 100644 index 00000000..8e3b5e65 --- /dev/null +++ b/pkg/trace/resolver.go @@ -0,0 +1,31 @@ +// Copyright 2023 Outreach Corporation. All Rights Reserved. + +// Description: This file contains + +package trace + +import ( + "context" + + "github.com/getoutreach/gobox/pkg/log" +) + +type InfoLoggingResolved int32 + +const ( + InfoLogging_Default InfoLoggingResolved = 0 + InfoLogging_Enabled InfoLoggingResolved = 1 + InfoLogging_Disabled InfoLoggingResolved = 2 +) + +type InfoLoggingResolver = func(ctx context.Context, operation string) InfoLoggingResolved + +func ResolvedLogging(logging InfoLoggingResolved) log.Marshaler { + if logging == InfoLogging_Default { + return nil + } + if logging == InfoLogging_Enabled { + return WithInfoLoggingDisabled() + } + return WithInfoLoggingDisabled() +}