Documentation ¶
Index ¶
- Constants
- func GetTraceIDWithGinContext(ctx *gin.Context) string
- func InitLogger(conf Config) error
- func NewOutgoingContextWithGinContext(ctx *gin.Context) context.Context
- func NewOutgoingContextWithIncomingContext(ctx context.Context) context.Context
- func NewTraceID() string
- func SetLevel(level LogLevel) error
- type Config
- type LogLevel
- type LogLevelFlag
- type Logger
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) GetTraceID() string
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
Constants ¶
View Source
const ( LoggerTraceKey = "logid" LogLevelFlagFatal LogLevelFlag = 1 LogLevelFlagPanic LogLevelFlag = 2 LogLevelFlagError LogLevelFlag = 3 LogLevelFlagWarn LogLevelFlag = 4 LogLevelFlagInfo LogLevelFlag = 5 LogLevelFlagDebug LogLevelFlag = 6 LogLevelFatal LogLevel = "FATAL" LogLevelPanic LogLevel = "PANIC" LogLevelError LogLevel = "ERROR" LogLevelWarn LogLevel = "WARN" LogLevelInfo LogLevel = "INFO" LogLevelDebug LogLevel = "DEBUG" )
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func NewTraceID ¶
func NewTraceID() string
Types ¶
type LogLevelFlag ¶
type LogLevelFlag int
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLoggerWithContext ¶
func NewLoggerWithGinContext ¶
func NewLoggerWithTraceID ¶
func (*Logger) GetTraceID ¶
Click to show internal directories.
Click to hide internal directories.