Documentation ¶
Index ¶
- type Logger
- type RequestIDKeyType
- type SimpleLogger
- func (logger SimpleLogger) EndRequest(start time.Time, ctx context.Context)
- func (logger SimpleLogger) GetRequestIdFromContext(ctx context.Context) string
- func (logger SimpleLogger) GetRequestIdKey() RequestIDKeyType
- func (logger SimpleLogger) HttpInfo(ctx context.Context, msg string, status int)
- func (logger SimpleLogger) HttpLogCallerError(ctx context.Context, objForPkgPath interface{}, err error)
- func (logger SimpleLogger) HttpLogError(ctx context.Context, pkg string, funcName string, err error)
- func (logger SimpleLogger) HttpLogInfo(ctx context.Context, msg string)
- func (logger SimpleLogger) HttpLogWarning(ctx context.Context, pkg string, funcName string, warn string)
- func (logger SimpleLogger) LogError(err error, msg string)
- func (logger SimpleLogger) StartRequest(r http.Request, requestId string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { GetRequestIdKey() RequestIDKeyType GetRequestIdFromContext(ctx context.Context) string StartRequest(r http.Request, requestId string) EndRequest(start time.Time, ctx context.Context) HttpInfo(ctx context.Context, msg string, status int) HttpLogWarning(ctx context.Context, pkg string, funcName string, warn string) HttpLogError(ctx context.Context, pkg string, funcName string, err error) HttpLogCallerError(ctx context.Context, objForPkgPath interface{}, err error) HttpLogInfo(ctx context.Context, msg string) LogError(err error, msg string) }
type RequestIDKeyType ¶
type RequestIDKeyType interface{}
type SimpleLogger ¶
func NewJsonFormatSimpleLogger ¶
func NewJsonFormatSimpleLogger(writer io.Writer, requestIDKey RequestIDKeyType) SimpleLogger
func NewSimpleLogger ¶
func NewSimpleLogger(writer io.Writer, formatter logrus.Formatter, requestIDKey RequestIDKeyType) SimpleLogger
func NewTextFormatSimpleLogger ¶
func NewTextFormatSimpleLogger(writer io.Writer, requestIDKey RequestIDKeyType) SimpleLogger
func (SimpleLogger) EndRequest ¶
func (logger SimpleLogger) EndRequest(start time.Time, ctx context.Context)
func (SimpleLogger) GetRequestIdFromContext ¶
func (logger SimpleLogger) GetRequestIdFromContext(ctx context.Context) string
func (SimpleLogger) GetRequestIdKey ¶
func (logger SimpleLogger) GetRequestIdKey() RequestIDKeyType
func (SimpleLogger) HttpInfo ¶
func (logger SimpleLogger) HttpInfo(ctx context.Context, msg string, status int)
func (SimpleLogger) HttpLogCallerError ¶
func (logger SimpleLogger) HttpLogCallerError(ctx context.Context, objForPkgPath interface{}, err error)
func (SimpleLogger) HttpLogError ¶
func (SimpleLogger) HttpLogInfo ¶
func (logger SimpleLogger) HttpLogInfo(ctx context.Context, msg string)
func (SimpleLogger) HttpLogWarning ¶
func (SimpleLogger) LogError ¶
func (logger SimpleLogger) LogError(err error, msg string)
func (SimpleLogger) StartRequest ¶
func (logger SimpleLogger) StartRequest(r http.Request, requestId string)
Click to show internal directories.
Click to hide internal directories.