# README
Logging entry point lib for Butik services
Fast start
- Select formatter:
formatter := &TextFormatter{ TextFormatter: logrus.TextFormatter{ForceColors: true, FullTimestamp: true}, } // Or this: formatter := &JSONFormatter{}
- Initialize logging instance:
goerrors.InitLog(goerrors.DebugLevel, formatter, nil)
- Use as logrus:
goerrors.Log().Info("test")
For detailed usage see code examples and comments in goerrors_test.go
Levels
TRACE, DEBUG, INFO --> stdout
WARN, ERROR, FATAL, PANIC --> stderr + Sentry
Requests logging and recovery
The library provides middleware for GRPC and HTTP servers:
r := mux.Router()
r.Use(goerrors.HTTPLoggingHandler) // INFO-level short info for every incoming request
r.Use(goerrors.HTTPRecoverer)
grpcServer := grpc.NewServer(
grpc.StreamInterceptor(GRPCStreamServerRecoverer()),
grpc.UnaryInterceptor(GRPCUnaryServerRecoverer()),
)
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author