Documentation ¶
Index ¶
- func DefaultLogRowHandle(value *freedom.LogRow) bool
- func GenerateTraceID() (string, error)
- func NewBusFilter() func(freedom.Worker)
- func NewClientPrometheus(serviceName string, p prom) requests.Handler
- func NewRecover() context.Handler
- func NewRequestLogger(traceIDName string, loggerConf ...*RequestLoggerConfig) func(context.Context)
- func NewTrace(traceIDName string) func(context.Context)
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Log(level golog.Level, v ...interface{})
- func (l *Logger) Logf(level golog.Level, format string, args ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, args ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) SetCallerLevel(level golog.Level)
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- type RequestLoggerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLogRowHandle ¶ added in v1.7.16
DefaultLogRowHandle The middleware output of the log line .
func GenerateTraceID ¶ added in v1.8.8
GenerateTraceID Build a unique ID.
func NewBusFilter ¶ added in v1.7.9
NewBusFilter Worker's middleware, filtering HTTP Header.
func NewClientPrometheus ¶ added in v1.8.4
NewClientPrometheus HTTP Client middleware that monitors requests made.
func NewRequestLogger ¶ added in v1.6.9
func NewRequestLogger(traceIDName string, loggerConf ...*RequestLoggerConfig) func(context.Context)
NewRequestLogger . Request the log. The name of the incoming trace, taken out of HTTP Header.
Types ¶
type Logger ¶ added in v1.8.8
type Logger struct {
// contains filtered or unexported fields
}
Logger The implementation of Logger..
func NewLogger ¶
NewLogger Create a Loger. The name and value of the incoming Trace. Requests should have their own Loger.
func (*Logger) Debug ¶ added in v1.8.8
func (l *Logger) Debug(v ...interface{})
Debug will print when freedomLogger's Level is debug.
func (*Logger) Error ¶ added in v1.8.8
func (l *Logger) Error(v ...interface{})
Error will print only when freedomLogger's Level is error, warn, info or debug.
func (*Logger) Errorf ¶ added in v1.8.8
Errorf will print only when freedomLogger's Level is error, warn, info or debug.
func (*Logger) Fatal ¶ added in v1.8.8
func (l *Logger) Fatal(v ...interface{})
Fatal `os.Exit(1)` exit no matter the level of the freedomLogger. If the freedomLogger's level is fatal, error, warn, info or debug then it will print the log message too.
func (*Logger) Fatalf ¶ added in v1.8.8
Fatalf will `os.Exit(1)` no matter the level of the freedomLogger. If the freedomLogger's level is fatal, error, warn, info or debug then it will print the log message too.
func (*Logger) Info ¶ added in v1.8.8
func (l *Logger) Info(v ...interface{})
Info will print when freedomLogger's Level is info or debug.
func (*Logger) Infof ¶ added in v1.8.8
Infof will print when freedomLogger's Level is info or debug.
func (*Logger) Log ¶ added in v1.8.8
Log prints a leveled log message to the output. This method can be used to use custom log levels if needed. It adds a new line in the end.
func (*Logger) Logf ¶ added in v1.8.8
Logf prints a leveled log message to the output. This method can be used to use custom log levels if needed. It adds a new line in the end.
func (*Logger) Print ¶ added in v1.8.8
func (l *Logger) Print(v ...interface{})
Print prints a log message without levels and colors.
func (*Logger) Printf ¶ added in v1.8.8
Printf formats according to a format specifier and writes to `Printer#Output` without levels and colors.
func (*Logger) Println ¶ added in v1.8.8
func (l *Logger) Println(v ...interface{})
Println prints a log message without levels and colors. It adds a new line at the end, it overrides the `NewLine` option.
func (*Logger) SetCallerLevel ¶ added in v1.8.12
SetCallerLevel .
type RequestLoggerConfig ¶ added in v1.7.16
type RequestLoggerConfig struct { Access bool IP bool Query bool MessageContextKeys []string MessageHeaderKeys []string RequestRawBody bool RequestRawBodyMaxLen int Title string CallerWithLevel []golog.Level // contains filtered or unexported fields }
RequestLoggerConfig Contains the options for the logger middleware can be optionally be passed to the `New`.
func DefaultLoggerConfig ¶ added in v1.8.0
func DefaultLoggerConfig() *RequestLoggerConfig
DefaultLoggerConfig returns a default config that have all boolean fields to true except `Columns`, all strings are empty, LogFunc and Skippers to nil as well.