-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow controlling of StartCall info logging via LD
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} |