summaryrefslogtreecommitdiff
path: root/internal/logger/logger_test.go
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2021-08-03 15:07:13 +0100
committerNick Thomas <nick@gitlab.com>2021-08-04 08:12:54 +0100
commit1274858f5565d59dcc36813964334a21fffc369b (patch)
treefc3c6b211c2272e7d3b1b1c206b55bf581380cd8 /internal/logger/logger_test.go
parent00735e0bbf51e28bcec5086d9d0f62999d19d2c5 (diff)
downloadgitlab-shell-1274858f5565d59dcc36813964334a21fffc369b.tar.gz
Switch to labkit for logging system setup
- We start supporting the "color" format for logs. - We now respond to SIGHUP by reopening the log file. - We now respect the log format when no log filename is specified. Output to syslog in the event of logging system setup is preserved in OpenSSH mode. Changelog: added
Diffstat (limited to 'internal/logger/logger_test.go')
-rw-r--r--internal/logger/logger_test.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/internal/logger/logger_test.go b/internal/logger/logger_test.go
index 6360ad9..43bd2ab 100644
--- a/internal/logger/logger_test.go
+++ b/internal/logger/logger_test.go
@@ -7,8 +7,9 @@ import (
"strings"
"testing"
- log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/labkit/log"
+
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
)
@@ -22,7 +23,9 @@ func TestConfigure(t *testing.T) {
LogFormat: "json",
}
- Configure(&config)
+ closer := Configure(&config)
+ defer closer.Close()
+
log.Info("this is a test")
tmpFile.Close()
@@ -42,7 +45,9 @@ func TestConfigureWithPermissionError(t *testing.T) {
LogFormat: "json",
}
- Configure(&config)
+ closer := Configure(&config)
+ defer closer.Close()
+
log.Info("this is a test")
}
@@ -57,7 +62,9 @@ func TestLogInUTC(t *testing.T) {
LogFormat: "json",
}
- Configure(&config)
+ closer := Configure(&config)
+ defer closer.Close()
+
log.Info("this is a test")
data, err := ioutil.ReadFile(tmpFile.Name())