Documentation ¶
Overview ¶
Logger Interface Use instance of logger instead of exported functions
usage example
import (
"errors" "github.com/rudderlabs/rudder-server/utils/logger"
)
var log logger.LoggerI = &logger.LoggerT{}
or
var log logger.LoggerI = logger.NewLogger()
...
log.Error(...)
Index ¶
- Variables
- func GetLoggingConfig() map[string]int
- func Init()
- func SetModuleLevel(module, levelStr string) error
- type LoggerI
- type LoggerT
- func (l *LoggerT) Child(s string) LoggerI
- func (l *LoggerT) Debug(args ...interface{})
- func (l *LoggerT) Debugf(format string, args ...interface{})
- func (l *LoggerT) Error(args ...interface{})
- func (l *LoggerT) Errorf(format string, args ...interface{})
- func (l *LoggerT) Fatal(args ...interface{})
- func (l *LoggerT) Fatalf(format string, args ...interface{})
- func (l *LoggerT) Info(args ...interface{})
- func (l *LoggerT) Infof(format string, args ...interface{})
- func (l *LoggerT) IsDebugLevel() bool
- func (l *LoggerT) LogRequest(req *http.Request)
- func (l *LoggerT) Warn(args ...interface{})
- func (l *LoggerT) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
var (
Log *zap.SugaredLogger
)
Functions ¶
func GetLoggingConfig ¶ added in v0.1.10
func SetModuleLevel ¶ added in v0.1.10
SetModuleLevel sets log level for a module and it's children Pass empty string for module parameter for resetting root logging level
Types ¶
type LoggerI ¶ added in v0.1.10
type LoggerI interface { IsDebugLevel() bool Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) LogRequest(req *http.Request) Child(s string) LoggerI }
type LoggerT ¶ added in v0.1.10
type LoggerT struct {
// contains filtered or unexported fields
}
func (*LoggerT) Debug ¶ added in v0.1.10
func (l *LoggerT) Debug(args ...interface{})
Debug level logging. Most verbose logging level.
func (*LoggerT) Debugf ¶ added in v0.1.10
Debugf does debug level logging similar to fmt.Printf. Most verbose logging level
func (*LoggerT) Error ¶ added in v0.1.10
func (l *LoggerT) Error(args ...interface{})
Error level logging. Use this to log errors which dont immediately halt the application.
func (*LoggerT) Errorf ¶ added in v0.1.10
Errorf does error level logging similar to fmt.Printf. Use this to log errors which dont immediately halt the application.
func (*LoggerT) Fatal ¶ added in v0.1.10
func (l *LoggerT) Fatal(args ...interface{})
Fatal level logging. Use this to log errors which crash the application.
func (*LoggerT) Fatalf ¶ added in v0.1.10
Fatalf does fatal level logging similar to fmt.Printf. Use this to log errors which crash the application.
func (*LoggerT) Info ¶ added in v0.1.10
func (l *LoggerT) Info(args ...interface{})
Info level logging. Use this to log the state of the application. Dont use Logger.Info in the flow of individual events. Use Logger.Debug instead.
func (*LoggerT) Infof ¶ added in v0.1.10
Infof does info level logging similar to fmt.Printf. Use this to log the state of the application. Dont use Logger.Info in the flow of individual events. Use Logger.Debug instead.
func (*LoggerT) IsDebugLevel ¶ added in v0.1.10
IsDebugLevel Returns true is debug lvl is enabled
func (*LoggerT) LogRequest ¶ added in v0.1.10
LogRequest reads and logs the request body and resets the body to original state.