Documentation
¶
Index ¶
- func Debug(fields Fields)
- func Debugf(fields Fields, format string, args ...any)
- func Error(fields Fields)
- func Errorf(fields Fields, format string, args ...any)
- func Fatal(fields Fields)
- func Fatalf(fields Fields, format string, args ...any)
- func Info(fields Fields)
- func Infof(fields Fields, format string, args ...any)
- func Log(level Level, fields Fields)
- func Logf(level Level, fields Fields, format string, args ...any)
- func Panic(fields Fields)
- func Panicf(fields Fields, format string, args ...any)
- func SetLevel(level Level)
- func SetMarshaller(marshaller Marshaller)
- func Warn(fields Fields)
- func Warnf(fields Fields, format string, args ...any)
- type Config
- type Entry
- type Fields
- type Level
- type Logger
- type Marshaller
- type Options
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetMarshaller ¶
func SetMarshaller(marshaller Marshaller)
Types ¶
type Config ¶
type Config struct { Level string `yaml:"level,omitempty" json:"level,omitempty" xml:"level,omitempty"` Formatter string `yaml:"formatter,omitempty" json:"formatter,omitempty" xml:"formatter,omitempty"` StdoutFilePath string `yaml:"stdout_file_path,omitempty" json:"stdout_file_path,omitempty" xml:"stdout_file_path,omitempty"` StderrFilePath string `yaml:"stderr_file_path,omitempty" json:"stderr_file_path,omitempty" xml:"stderr_file_path,omitempty"` }
type Entry ¶
type Entry struct { File string `json:"file" yaml:"file" xml:"file"` Level string `json:"level" yaml:"level" xml:"level"` CallTime string `json:"call_time" yaml:"call_time" xml:"call_time"` Service string `json:"service" yaml:"service" xml:"service"` TraceID string `json:"trace_id" yaml:"trace_id" xml:"trace_id"` Message string `json:"message,omitempty" yaml:"message,omitempty" xml:"message,omitempty"` Data any `json:"data,omitempty" yaml:"data,omitempty" xml:"data,omitempty"` Extra map[string]any `json:"extra,omitempty" yaml:"extra,omitempty" xml:"extra,omitempty"` // contains filtered or unexported fields }
type Fields ¶
type Fields interface { WithTraceID(traceID string) Fields WithMessage(message string) Fields WithData(data any) Fields WithField(key string, value any) Fields WithLevel(level Level) Fields WithService(service string) Fields WithCallTime(callTime time.Time) Fields WithBaseFields(base Fields) Fields // contains filtered or unexported methods }
type Logger ¶
type Logger interface { Debug(fields Fields) Info(fields Fields) Warn(fields Fields) Error(fields Fields) Fatal(fields Fields) Panic(fields Fields) Log(level Level, fields Fields) Logf(level Level, fields Fields, format string, args ...any) Debugf(fields Fields, format string, args ...any) Infof(fields Fields, format string, args ...any) Warnf(fields Fields, format string, args ...any) Errorf(fields Fields, format string, args ...any) Fatalf(fields Fields, format string, args ...any) Panicf(fields Fields, format string, args ...any) // contains filtered or unexported methods }
func NewLoggerWithConfig ¶
type Marshaller ¶
var ( JsonMarshaller Marshaller = jsonMarshaller TextMarshaller Marshaller = textMarshaller CsvMarshaller Marshaller = csvMarshaller TsvMarshaller Marshaller = tsvMarshaller )
type Options ¶
type Options struct { LogLevel Level Marshaller Marshaller StdoutWriter Writer StderrWriter Writer // contains filtered or unexported fields }
type Writer ¶
type Writer interface { Write(data []byte) Close() // contains filtered or unexported methods }
func ConsoleErrorWriter ¶
func ConsoleErrorWriter() Writer
func ConsoleWriter ¶
func ConsoleWriter() Writer
func FileWriter ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.