Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update phuslog to fix typo #499

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions providers/phuslog/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (

func Example_initializationWithCustomLevels() {
// Logger is used, allowing pre-definition of certain fields by the user.
logger := log.DefaultLogger.GrcpGateway()
logger := log.DefaultLogger.GrpcGateway()
// Shared options for the logger, with a custom gRPC code to log level function.
opts := []logging.Option{
logging.WithLevels(customFunc),
Expand All @@ -40,7 +40,7 @@ func Example_initializationWithCustomLevels() {

func Example_initializationWithDurationFieldOverride() {
// Logger is used, allowing pre-definition of certain fields by the user.
logger := log.DefaultLogger.GrcpGateway()
logger := log.DefaultLogger.GrpcGateway()
// Shared options for the logger, with a custom duration to log field function.
opts := []logging.Option{
logging.WithDurationField(customDurationToFields),
Expand All @@ -58,7 +58,7 @@ func Example_initializationWithDurationFieldOverride() {

func ExampleWithDecider() {
// Logger is used, allowing pre-definition of certain fields by the user.
logger := log.DefaultLogger.GrcpGateway()
logger := log.DefaultLogger.GrpcGateway()
// Shared options for the logger, with a custom decider that log everything except successful
// calls from "/blah.foo.healthcheck/Check" method.
opts := []logging.Option{
Expand All @@ -85,7 +85,7 @@ func ExampleWithDecider() {

func ExampleServerPayloadLoggingDecider() {
// Logger is used, allowing pre-definition of certain fields by the user.
logger := log.DefaultLogger.GrcpGateway()
logger := log.DefaultLogger.GrpcGateway()
// Expect payload from "/blah.foo.healthcheck/Check" call to be logged.
payloadDecider := func(ctx context.Context, fullMethodName string, servingObject interface{}) bool {
return fullMethodName == "/blah.foo.healthcheck/Check"
Expand Down
2 changes: 1 addition & 1 deletion providers/phuslog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ go 1.14

require (
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201002093600-73cf2ae9d891
github.com/phuslu/log v1.0.72
github.com/phuslu/log v1.0.80
google.golang.org/grpc v1.30.0
)
4 changes: 2 additions & 2 deletions providers/phuslog/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201002093600-73c
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/phuslu/log v1.0.72 h1:bjAbUBXqipXi0TCnpkqArnFSU6qd0U+Js5aATJmRj3g=
github.com/phuslu/log v1.0.72/go.mod h1:kzJN3LRifrepxThMjufQwS7S35yFAB+jAV1qgA7eBW4=
github.com/phuslu/log v1.0.80 h1:spAqKcba2lTTpxp6uBFLSVZrtirHiD4B8UepJdXR0H4=
github.com/phuslu/log v1.0.80/go.mod h1:kzJN3LRifrepxThMjufQwS7S35yFAB+jAV1qgA7eBW4=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
4 changes: 2 additions & 2 deletions providers/phuslog/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ var _ logging.Logger = &Logger{}

// Logger is a phuslog logging adapter compatible with logging middlewares.
type Logger struct {
log.GrcpGatewayLogger
log.GrpcGatewayLogger
}

// InterceptorLogger is a phuslog.Logger to Logger adapter.
func InterceptorLogger(logger log.GrcpGatewayLogger) *Logger {
func InterceptorLogger(logger log.GrpcGatewayLogger) *Logger {
return &Logger{logger}
}

Expand Down