forked from blendle/zapdriver
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogger_test.go
48 lines (37 loc) · 1013 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
45
46
47
48
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 TestNewProductionWithConfig(t *testing.T) {
logger, err := NewProductionWithConfig(
DriverConfig{
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 TestNewDevelopmentWithConfig(t *testing.T) {
logger, err := NewDevelopmentWithConfig(
DriverConfig{
ReportAllErrors: true,
},
zap.Fields(zap.String("hello", "world")),
)
require.NoError(t, err)
assert.IsType(t, &zap.Logger{}, logger)
}