Documentation ¶
Index ¶
- func ColorSprintf(c Color, format string, a ...interface{}) string
- func Debug(a ...interface{})
- func DebugWithContext(ctx context.Context, a ...interface{})
- func DebugWithTraceID(traceID string, a ...interface{})
- func Debugf(format string, a ...interface{})
- func DebugfWithContext(ctx context.Context, format string, a ...interface{})
- func DebugfWithTraceID(traceID string, format string, a ...interface{})
- func Error(a ...interface{})
- func ErrorWithContext(ctx context.Context, a ...interface{})
- func ErrorWithTraceID(traceID string, a ...interface{})
- func Errorf(format string, a ...interface{})
- func ErrorfWithContext(ctx context.Context, format string, a ...interface{})
- func ErrorfWithTraceID(traceID string, format string, a ...interface{})
- func Fatal(a ...interface{})
- func FatalWithContext(ctx context.Context, a ...interface{})
- func FatalWithTraceID(traceID string, a ...interface{})
- func Fatalf(format string, a ...interface{})
- func FatalfWithContext(ctx context.Context, format string, a ...interface{})
- func FatalfWithTraceID(traceID string, format string, a ...interface{})
- func Info(a ...interface{})
- func InfoWithContext(ctx context.Context, a ...interface{})
- func InfoWithTraceID(traceID string, a ...interface{})
- func Infof(format string, a ...interface{})
- func InfofWithContext(ctx context.Context, format string, a ...interface{})
- func InfofWithTraceID(traceID string, format string, a ...interface{})
- func NewConsoleEncodeWriter() *consoleEncodeWriter
- func NewFileEncodeWriter(cfg Config) *fileEncodeWriter
- func OpenLog(app string, opts ...Option)
- func OpenLogWithConfig(app string, cfg Config)
- func Panic(a ...interface{})
- func PanicWithContext(ctx context.Context, a ...interface{})
- func PanicWithTraceID(traceID string, a ...interface{})
- func Panicf(format string, a ...interface{})
- func PanicfWithContext(ctx context.Context, format string, a ...interface{})
- func PanicfWithTraceID(traceID string, format string, a ...interface{})
- func Warn(a ...interface{})
- func WarnWithContext(ctx context.Context, a ...interface{})
- func WarnWithTraceID(traceID string, a ...interface{})
- func Warnf(format string, a ...interface{})
- func WarnfWithContext(ctx context.Context, format string, a ...interface{})
- func WarnfWithTraceID(traceID string, format string, a ...interface{})
- type Color
- type Config
- type EncodeWriter
- type Entry
- type ILogger
- type Level
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(a ...interface{})
func DebugfWithContext ¶
func Error ¶
func Error(a ...interface{})
func ErrorfWithContext ¶
func Fatal ¶
func Fatal(a ...interface{})
func FatalfWithContext ¶
func Info ¶
func Info(a ...interface{})
func NewConsoleEncodeWriter ¶
func NewConsoleEncodeWriter() *consoleEncodeWriter
func Panic ¶
func Panic(a ...interface{})
func PanicfWithContext ¶
func Warn ¶
func Warn(a ...interface{})
Types ¶
type Config ¶
type Config struct { Level Level `yaml:"level" env:"LOG_LEVEL"` //the min level for output WithCaller bool `yaml:"with_caller" env:"WITH_CALLER"` //output the caller file path File fileConfig `yaml:"file"` WithStack bool `yaml:"with_stack"` //output the stack while error level // contains filtered or unexported fields }
type EncodeWriter ¶
type Entry ¶
type ILogger ¶
type Level ¶
type Level int8
const ( // DebugLevel logs are typically voluminous, and are usually disabled in production. DebugLevel Level = iota // InfoLevel is the default logging priority. InfoLevel // WarnLevel logs are more important than Info, but don't need individual human review. WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel // PanicLevel logs a message, then panics. PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) LogWithContext ¶
Click to show internal directories.
Click to hide internal directories.