mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
databroker: use contextual logging for errors, use original record type for encryption (#3096)
This commit is contained in:
parent
8567b56b8d
commit
aaff52fc61
3 changed files with 10 additions and 10 deletions
|
@ -114,6 +114,13 @@ func Warn(ctx context.Context) *zerolog.Event {
|
|||
return contextLogger(ctx).Warn()
|
||||
}
|
||||
|
||||
// Error starts a new message with error level.
|
||||
//
|
||||
// You must call Msg on the returned event in order to send the event.
|
||||
func Error(ctx context.Context) *zerolog.Event {
|
||||
return contextLogger(ctx).Error()
|
||||
}
|
||||
|
||||
func contextLogger(ctx context.Context) *zerolog.Logger {
|
||||
global := Logger()
|
||||
if global.GetLevel() == zerolog.Disabled {
|
||||
|
@ -133,13 +140,6 @@ func WithContext(ctx context.Context, update func(c zerolog.Context) zerolog.Con
|
|||
return l.WithContext(ctx)
|
||||
}
|
||||
|
||||
// Error starts a new message with error level.
|
||||
//
|
||||
// You must call Msg on the returned event in order to send the event.
|
||||
func Error(ctx context.Context) *zerolog.Event {
|
||||
return Logger().Error()
|
||||
}
|
||||
|
||||
// Fatal starts a new message with fatal level. The os.Exit(1) function
|
||||
// is called by the Msg method.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue