Skip to content

Commit d58b1b1

Browse files
committed
deleted old print statements, adjusted logic for interval floor
1 parent aaa5fec commit d58b1b1

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

BaseLogger_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ func TestSubmitsToDeniedUrl(t *testing.T) {
188188
assert.True(t, logger.Enabled())
189189
logger.ndjsonHandler("{}")
190190
time.Sleep(5 * time.Second) // Added because with async worker the test was checking for fail/success values before worker could actually try sending the request.
191-
fmt.Print("\n***************")
192-
fmt.Print(logger.submitFailures)
193-
fmt.Print(" | ")
194-
fmt.Print(logger.submitSuccesses)
195-
fmt.Print("***************\n")
196191
assert.Equal(t, int64(1), logger.submitFailures)
197192
assert.Equal(t, int64(0), logger.submitSuccesses)
198193
}

HttpMessage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ func SendHttpMessage(logger *HttpLogger, resp *http.Response, req *http.Request,
116116
message = append(message, []string{"now", strconv.FormatInt(now, 10)})
117117

118118
// append interval noting the time between request and response
119-
if interval >= 1 {
119+
if interval != 0 {
120120
message = append(message, []string{"interval", strconv.FormatInt(interval, 10)})
121-
} else if interval < 1 {
121+
} else {
122122
message = append(message, []string{"interval", strconv.FormatInt(1, 10)})
123123
}
124124

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ go 1.15
55
require (
66
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
77
github.com/joho/godotenv v1.3.0
8+
github.com/resurfaceio/logger-go/v2 v2.0.1 // indirect
89
github.com/stretchr/testify v1.7.0
910
)

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
66
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
77
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
88
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9+
github.com/resurfaceio/logger-go v1.2.0 h1:X3wzy4w6AfQLCrXjf9Oz9s8cenn6e1ezeJHTRHe91dQ=
10+
github.com/resurfaceio/logger-go/v2 v2.0.1 h1:kimxnuzhLYBH/ATN0+WYcSwAKCz4vSrdpqncFGdITfk=
11+
github.com/resurfaceio/logger-go/v2 v2.0.1/go.mod h1:M4gj7jev+IedyMEtwIDq7lP5bRylr9TbHj9KHRkBch4=
912
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1013
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
1114
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=

0 commit comments

Comments
 (0)