Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Lindfalk committed May 20, 2022
1 parent 8e8ab3e commit 19dc81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {
logger := logging.NewLogger(
&logging.LoggerConfig{
OnGCP: true,
AppName: "mysuperduper-service",
ServiceName: "mysuperduper-service",
},
)
defer logger.Sync() // flushes buffer, if any
Expand Down
6 changes: 3 additions & 3 deletions pkg/logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type LoggerWithContext struct {
}

type LoggerConfig struct {
OnGCP bool
AppName string
OnGCP bool
ServiceName string
}

func NewLogger(config *LoggerConfig) *Logger {
Expand All @@ -36,7 +36,7 @@ func NewLogger(config *LoggerConfig) *Logger {
log, err = zapdriver.NewProductionWithCore(
zapdriver.WrapCore(
zapdriver.ReportAllErrors(true),
zapdriver.ServiceName(config.AppName),
zapdriver.ServiceName(config.ServiceName),
),
)
} else {
Expand Down

0 comments on commit 19dc81b

Please sign in to comment.