Skip to content

Commit

Permalink
use empty logger if logger was not provided
Browse files Browse the repository at this point in the history
Signed-off-by: denis-tingaikin <denis.tingajkin@xored.com>
  • Loading branch information
denis-tingaikin committed Dec 19, 2024
1 parent 2cbf102 commit a3d66f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/tools/log/logger.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2023 Cisco Systems, Inc.
// Copyright (c) 2023-2024 Cisco Systems, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -33,6 +33,7 @@ const (
var (
isTracingEnabled int32 = 0
globalLogger Logger = Default()
emptyLogger Logger = new(emptylogger)
)

// Logger - unified interface for logging
Expand Down Expand Up @@ -72,7 +73,7 @@ func FromContext(ctx context.Context) Logger {
if ok {
return rv
}
return L()
return emptyLogger
}

// Join - concatenates new logger with existing loggers
Expand Down

0 comments on commit a3d66f5

Please sign in to comment.