mirror of
https://github.com/pyihe/go-pkg.git
synced 2025-09-26 20:11:21 +08:00
fix
This commit is contained in:
@@ -7,6 +7,14 @@ import (
|
||||
"github.com/pyihe/go-pkg/errors"
|
||||
)
|
||||
|
||||
func Copy(src []byte) (b []byte) {
|
||||
if len(src) > 0 {
|
||||
b = make([]byte, len(src))
|
||||
copy(b, src)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func Int64(b []byte) (v int64, err error) {
|
||||
if len(b) == 0 {
|
||||
return
|
||||
|
@@ -57,7 +57,7 @@ func newZapLogger(opts ...LogOption) (Logger, error) {
|
||||
|
||||
encoder := getJSONEncoder()
|
||||
|
||||
op := zap.Fields(zap.String("ip", nets.GetLocalIP()), zap.String("app", zlogger.name))
|
||||
op := zap.Fields(zap.String("ip", nets.LocalIP()), zap.String("app", zlogger.name))
|
||||
options = append(options, op)
|
||||
|
||||
allLevel := zap.LevelEnablerFunc(func(lv zapcore.Level) bool {
|
||||
|
Reference in New Issue
Block a user