Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDevelopmentLogger ¶
Example ¶
package main import ( "log" "github.com/ecumenos/orbis-socius/pkg/logger" ) func main() { serviceName := "MyService" devLogger, err := logger.NewDevelopmentLogger(serviceName) if err != nil { log.Fatal(err) } sugaredLogger := devLogger.Sugar() sugaredLogger.Infow("Log the logs", "logName", "loggy", "logValue", 1.2) // Outputs to stderr: {"level":"info","time":"2018-12-11T21:17:06.128Z","caller":"zapconf/zapconf_test.go:28","msg":"Log the logs","service":"MyService","logName":"loggy","logValue":1.2} }
Output:
func NewProductionLogger ¶
Example ¶
package main import ( "log" "github.com/ecumenos/orbis-socius/pkg/logger" ) func main() { serviceName := "MyService" prodLogger, err := logger.NewProductionLogger(serviceName) if err != nil { log.Fatal(err) } sugaredLogger := prodLogger.Sugar() sugaredLogger.Errorw("Log the logs", "logName", "loggy", "logValue", 1.2) // Outputs to stderr: {"level":"error","time":"2018-12-11T21:17:06.128Z","caller":"zapconf/zapconf_test.go:28","msg":"Log the logs","service":"MyService","logName":"loggy","logValue":1.2} }
Output:
func NewZapLogger ¶
func NewZapLogger(serviceName ecumenosfx.ServiceName, prod bool, lc fx.Lifecycle) (*zap.Logger, error)
func ZapSugared ¶
func ZapSugared(log *zap.Logger) *zap.SugaredLogger
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.