-
Notifications
You must be signed in to change notification settings - Fork 45
/
logger_test.go
44 lines (33 loc) · 981 Bytes
/
logger_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package zapdriver
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
)
func TestNewProduction(t *testing.T) {
logger, err := NewProduction(zap.Fields(zap.String("hello", "world")))
require.NoError(t, err)
assert.IsType(t, &zap.Logger{}, logger)
}
func TestNewProductionWithCore(t *testing.T) {
logger, err := NewProductionWithCore(
WrapCore(ReportAllErrors(true)),
zap.Fields(zap.String("hello", "world")),
)
require.NoError(t, err)
assert.IsType(t, &zap.Logger{}, logger)
}
func TestNewDevelopment(t *testing.T) {
logger, err := NewDevelopment(zap.Fields(zap.String("hello", "world")))
require.NoError(t, err)
assert.IsType(t, &zap.Logger{}, logger)
}
func TestNewDevelopmentWithCore(t *testing.T) {
logger, err := NewDevelopmentWithCore(
WrapCore(ReportAllErrors(true)),
zap.Fields(zap.String("hello", "world")),
)
require.NoError(t, err)
assert.IsType(t, &zap.Logger{}, logger)
}