Skip to content

Commit

Permalink
update phuslog to fix typo (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogimenezb authored Jul 14, 2022
1 parent 58a4066 commit 5d0f5fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
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

0 comments on commit 5d0f5fe

Please sign in to comment.