Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-09-21 13:37:21 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-09-21 14:27:36 +0300
commit9a75130ccaa40ec64ef4ebee81bff1f444335469 (patch)
tree5f23f1a52bdb7933faa47920321c98c3880d0591 /internal/command
parente52fdb6a6f09a1cfe7192272a7aabff0d7c84c4b (diff)
log: Hide away the `logrus.Entry` interface
The `log.LogrusLogger` type directly wraps the `logrus.Entry`, thus exposing all of its functions. We don't want anybody to call them in the ideal case so that we can ensure that we use our own logging interface almost exclusively throughout the codebase. Let's hide the `logrus.Entry` by making it a private member of the `log.LogrusLogger`. While this requires us to explicitly implement some of the expected interface-level functions, by now it's really only four of them and thus manageable. There are still some very limited callsites in our tests that require access to the `logrus.Entry`, which will be addressed in another iteration. Meanwhile, we expose an explicit `LogrusEntry()` getter that makes the entry accessible to those usecases.
Diffstat (limited to 'internal/command')
-rw-r--r--internal/command/command_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/command/command_test.go b/internal/command/command_test.go
index ad1b5fd6c..209e84b3b 100644
--- a/internal/command/command_test.go
+++ b/internal/command/command_test.go
@@ -494,7 +494,7 @@ func TestCommand_logMessage(t *testing.T) {
t.Parallel()
logger := testhelper.NewLogger(t)
- logger.Logger.SetLevel(logrus.DebugLevel)
+ logger.LogrusEntry().Logger.SetLevel(logrus.DebugLevel) //nolint:staticcheck
hook := testhelper.AddLoggerHook(logger)
ctx := logger.ToContext(testhelper.Context(t))