From da20086100903908259e29d0e5067f935f96b074 Mon Sep 17 00:00:00 2001 From: Tomer Froumin Date: Tue, 27 Feb 2024 16:52:13 +0200 Subject: [PATCH] Fixed logrus hook tests --- hook_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hook_test.go b/hook_test.go index 6ed2eae..9bb7080 100644 --- a/hook_test.go +++ b/hook_test.go @@ -60,9 +60,9 @@ func TestHook_Send(t *testing.T) { }, { name: "test info", - severity: Level.ERROR, + severity: Level.INFO, logfn: func(args ...interface{}) { - log.WithFields(fields).Error(args...) + log.WithFields(fields).Info(args...) }, }, { @@ -98,7 +98,7 @@ func TestHook_Send(t *testing.T) { }) } - // test with caller\ + // test with caller log.SetReportCaller(true) for _, tc := range testcases { tc.name = fmt.Sprintf("%s_withReportCaller", tc.name) @@ -115,7 +115,7 @@ func TestHook_Send(t *testing.T) { assert.Equal(t, tc.severity, entry.Severity) assert.Equal(t, fields["Category"], entry.Category) assert.Equal(t, fields["ThreadId"], entry.ThreadID, - "expected %v, got %v", fields["MyThreadId"], entry.ThreadID) + "expected %v, got %v", fields["ThreadId"], entry.ThreadID) assert.True(t, strings.Contains(entry.Text, fields["extra"].(string)), "entry Text does not contain extra field", entry.Text, fields["extra"]) break