mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
feat(GODT-2691): close logrus output file on exit.
This commit is contained in:
@ -23,6 +23,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/constants"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@ -93,3 +94,12 @@ func TestLogging_GetOrderedLogFileListForBugReport(t *testing.T) {
|
||||
filepath.Join(dir, string(sessionID1)+"_lau_000"+fileSuffix),
|
||||
}, filePaths)
|
||||
}
|
||||
|
||||
func TestLogging_Close(t *testing.T) {
|
||||
d := t.TempDir()
|
||||
closer, err := Init(d, NewSessionID(), constants.AppName, 1, DefaultPruningSize, "debug")
|
||||
require.NoError(t, err)
|
||||
logrus.Debug("Test") // because we set max log file size to 1, this will force a rotation of the log file.
|
||||
require.NotNil(t, closer)
|
||||
require.NoError(t, closer.Close())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user