Documentation
¶
Index ¶
- Constants
- Variables
- func Debug(msg string, fields ...zapcore.Field)
- func DebugContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func Error(msg string, fields ...zapcore.Field)
- func ErrorContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func Fatal(msg string, fields ...zapcore.Field)
- func FatalContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func GetDefaultLogger() *otelzap.Logger
- func GetTraceID(ctx context.Context) string
- func Info(msg string, fields ...zapcore.Field)
- func InfoContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func InitLogger(logPath string, level string, opts ...Option)
- func Named(s string) *otelzap.Logger
- func Warn(msg string, fields ...zapcore.Field)
- func WarnContext(ctx context.Context, msg string, fields ...zapcore.Field)
- type Config
- type Option
Constants ¶
View Source
const LabelLevel = "level"
Variables ¶
View Source
var (
DefaultLogger *otelzap.Logger
)
Functions ¶
func DebugContext ¶ added in v0.0.2
func ErrorContext ¶ added in v0.0.2
func FatalContext ¶ added in v0.0.2
func GetDefaultLogger ¶
func GetTraceID ¶ added in v0.1.0
GetTraceID returns the 32-character lowercase hexadecimal string of the TraceID from the current context. Returns an empty string if there is no Span in the ctx.
func InfoContext ¶ added in v0.0.2
func InitLogger ¶
Types ¶
type Config ¶ added in v0.1.0
type Config struct {
lumberjack.Logger
WithTraceID bool
}
type Option ¶ added in v0.0.7
type Option func(c *Config)
func WithCompress ¶ added in v0.0.7
func WithMaxBackups ¶ added in v0.0.7
func WithTraceID ¶ added in v0.1.0
WithTraceIDField configures the logger to add `trace_id` field to structured log messages.
Click to show internal directories.
Click to hide internal directories.