You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
366 B
19 lines
366 B
1 year ago
|
package logx
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func Test_nsqLogger_Log(t *testing.T) {
|
||
|
nsqWriter := NewNsqLogger("localhost:4150", "app_log")
|
||
|
nsqWriter.Start(context.Background())
|
||
|
logger := With(nsqWriter,
|
||
|
"ts", DefaultTimestamp,
|
||
|
"caller", DefaultCaller,
|
||
|
)
|
||
|
logger.Log(LevelInfo, "user name ttt")
|
||
|
fmt.Println(nsqWriter.Stop(context.Background()))
|
||
|
}
|