Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // output overrides default logging to os.Stderr Output io.Writer // setting with log-level should be written to output. (default: Info) LogLevel Level // enable colored logging to console, otherwise use JSON logger. (default: false) EnableConsoleLogger bool // WithCaller logs the path and linenumber of the caller. // This should not be used in production WithCaller bool // contains filtered or unexported fields }
Config configured the logging.
type CustomLogger ¶ added in v0.1.8
CustomLogger implements the estransport.Logger interface.
func NewLogger ¶
func NewLogger(cfg Config) CustomLogger
NewLogger creates zerolog.Logger with sensible defaults
func (*CustomLogger) LogRoundTrip ¶ added in v0.1.8
func (l *CustomLogger) LogRoundTrip( req *http.Request, res *http.Response, err error, start time.Time, dur time.Duration, ) error
LogRoundTrip prints the information about request and response.
func (*CustomLogger) RequestBodyEnabled ¶ added in v0.1.8
func (l *CustomLogger) RequestBodyEnabled() bool
RequestBodyEnabled makes the client pass request body to logger
func (*CustomLogger) ResponseBodyEnabled ¶ added in v0.1.8
func (l *CustomLogger) ResponseBodyEnabled() bool
ResponseBodyEnabled makes the client pass response body to logger
type Level ¶
type Level int8
Level defines log levels.
const ( // DebugLevel defines debug log level. DebugLevel Level = iota // InfoLevel defines info log level. InfoLevel // WarnLevel defines warn log level. WarnLevel // ErrorLevel defines error log level. ErrorLevel // FatalLevel defines fatal log level. FatalLevel // PanicLevel defines panic log level. PanicLevel // NoLevel defines an absent log level. NoLevel // Disabled disables the logger. Disabled // TraceLevel defines trace log level. TraceLevel Level = -1 )
func ParseLogLevel ¶
type WrapDebug ¶
type WrapDebug struct {
// contains filtered or unexported fields
}
func NewWrapDebug ¶
type WrapError ¶
type WrapError struct {
// contains filtered or unexported fields
}
func NewWrapError ¶
type WrapInfo ¶
type WrapInfo struct {
// contains filtered or unexported fields
}
func NewWrapInfo ¶
Click to show internal directories.
Click to hide internal directories.