Documentation ¶
Index ¶
- Variables
- func Caller() string
- func Errorf(format string, args ...any) error
- func Format(format string, args ...any) string
- func FormatDepth(depth int, format string, args ...any) string
- func FuncInfo(f interface{}) string
- type CompatLogWriter
- type CompatRegistry
- type LogLevel
- type LogWriter
- type TestLogWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var Log = NewLogWriter()
View Source
var Registry = &CompatRegistry{ nextId: 1, loggers: make(map[int]CompatLogWriter), }
Functions ¶
Types ¶
type CompatLogWriter ¶
type CompatLogWriter interface { SetLevel(level LogLevel) Syslog(bool) error Level() LogLevel SetPrefix(prefix string) Packetf(format string, args ...any) Debugf(format string, args ...any) Infof(format string, args ...any) Warnf(format string, args ...any) Errorf(f string, args ...any) Fatalf(format string, args ...any) ErrFmt(format string, args ...any) error Prefix() string Write(data []byte) (int, error) Json(label string, data any, indent bool) Flush() SetId(id int) Id() int }
func NewCompatLogWriter ¶
func NewCompatLogWriter(level LogLevel) CompatLogWriter
func NewTestCompatLogWriter ¶
func NewTestCompatLogWriter(t *testing.T) CompatLogWriter
type CompatRegistry ¶
func (*CompatRegistry) Add ¶
func (r *CompatRegistry) Add(log CompatLogWriter)
func (*CompatRegistry) Command ¶
func (r *CompatRegistry) Command(args []string) []string
func (*CompatRegistry) List ¶
func (r *CompatRegistry) List() []CompatLogWriter
func (*CompatRegistry) LookupById ¶
func (r *CompatRegistry) LookupById(id int) CompatLogWriter
func (*CompatRegistry) NewId ¶
func (r *CompatRegistry) NewId() int
type LogWriter ¶
type LogWriter interface { Printf(format string, args ...any) Fatalf(format string, args ...any) SetPrefix(prefix string) Errorf(f string, args ...any) error PrettyPrint(arg interface{}) }
func NewLogWriter ¶
func NewLogWriter() LogWriter
func NewTestLogWriter ¶
type TestLogWriter ¶
type TestLogWriter struct {
// contains filtered or unexported fields
}
func (TestLogWriter) Fatalf ¶
func (lw TestLogWriter) Fatalf(format string, args ...any)
func (TestLogWriter) PrettyPrint ¶
func (lw TestLogWriter) PrettyPrint(arg interface{})
func (TestLogWriter) Printf ¶
func (lw TestLogWriter) Printf(format string, args ...any)
func (TestLogWriter) SetPrefix ¶
func (lw TestLogWriter) SetPrefix(prefix string)
Click to show internal directories.
Click to hide internal directories.