Skip to content

Commit 9ebac15

Browse files
committed
perfect: core -> logger
1 parent 8ca0200 commit 9ebac15

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

internal/dep/core.go

-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ package dep
22

33
import (
44
"github.com/google/wire"
5-
logger "github.com/lhdhtrc/logger-go/pkg"
65
task "github.com/lhdhtrc/task-go/pkg"
7-
"go-layout/internal/biz"
86
"go-layout/internal/conf"
9-
"go.uber.org/zap"
107
"google.golang.org/grpc"
118
"google.golang.org/grpc/credentials/insecure"
129
)
@@ -26,10 +23,6 @@ func NewTask(bc *conf.BootstrapConf) *task.Instance {
2623
return task.New(bc.Task)
2724
}
2825

29-
func NewLogger(bc *conf.BootstrapConf, handle biz.ServerLogger) *zap.Logger {
30-
return logger.New(bc.Logger, handle)
31-
}
32-
3326
func NewGrpcClient(bc *conf.BootstrapConf) (*grpc.ClientConn, error) {
3427
var addr string
3528
if bc.Gateway.Network == bc.Micro.Network {

internal/dep/logger.go

+6
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
logger "github.com/lhdhtrc/logger-go/pkg"
78
accessLogger "go-layout/dep/protobuf/gen/acme/logger/access/v1"
89
operationLogger "go-layout/dep/protobuf/gen/acme/logger/operation/v1"
910
serverLogger "go-layout/dep/protobuf/gen/acme/logger/server/v1"
1011
"go-layout/internal/biz"
1112
"go-layout/internal/conf"
13+
"go.uber.org/zap"
1214
"time"
1315
)
1416

17+
func NewLogger(bc *conf.BootstrapConf, handle biz.ServerLogger) *zap.Logger {
18+
return logger.New(bc.Logger, handle)
19+
}
20+
1521
func NewAccessLogger(bc *conf.BootstrapConf, service accessLogger.AccessLoggerServiceClient) biz.AccessLogger {
1622
return func(b []byte, msg string) {
1723
if bc.Logger.Console {

0 commit comments

Comments
 (0)