log

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastLogger

type BroadcastLogger struct {
	Logger
	// contains filtered or unexported fields
}

func NewBroadcastLogger

func NewBroadcastLogger(logger Logger) *BroadcastLogger

func (*BroadcastLogger) Close

func (s *BroadcastLogger) Close()

func (*BroadcastLogger) Register

func (*BroadcastLogger) Unregister

func (s *BroadcastLogger) Unregister(ctx context.Context)

type BroadcastMessage

type BroadcastMessage struct {
	Time            time.Time     `json:"time"`
	Level           Level         `json:"level"`
	Message         string        `json:"message"`
	ContextID       uint32        `json:"context_id,omitempty"`
	ContextDuration time.Duration `json:"context_duration,omitempty"`
}

type ExportLogger

type ExportLogger struct {
	// contains filtered or unexported fields
}

func (*ExportLogger) Debug

func (l *ExportLogger) Debug(args ...interface{})

func (*ExportLogger) DebugContext

func (l *ExportLogger) DebugContext(ctx context.Context, args ...interface{})

func (*ExportLogger) Debugf

func (l *ExportLogger) Debugf(format string, args ...interface{})

func (*ExportLogger) DebugfContext

func (l *ExportLogger) DebugfContext(ctx context.Context, format string, args ...interface{})

func (*ExportLogger) Error

func (l *ExportLogger) Error(args ...interface{})

func (*ExportLogger) ErrorContext

func (l *ExportLogger) ErrorContext(ctx context.Context, args ...interface{})

func (*ExportLogger) Errorf

func (l *ExportLogger) Errorf(format string, args ...interface{})

func (*ExportLogger) ErrorfContext

func (l *ExportLogger) ErrorfContext(ctx context.Context, format string, args ...interface{})

func (*ExportLogger) Fatal

func (l *ExportLogger) Fatal(args ...interface{})

func (*ExportLogger) FatalContext

func (l *ExportLogger) FatalContext(ctx context.Context, args ...interface{})

func (*ExportLogger) Fatalf

func (l *ExportLogger) Fatalf(format string, args ...interface{})

func (*ExportLogger) FatalfContext

func (l *ExportLogger) FatalfContext(ctx context.Context, format string, args ...interface{})

func (*ExportLogger) Info

func (l *ExportLogger) Info(args ...interface{})

func (*ExportLogger) InfoContext

func (l *ExportLogger) InfoContext(ctx context.Context, args ...interface{})

func (*ExportLogger) Infof

func (l *ExportLogger) Infof(format string, args ...interface{})

func (*ExportLogger) InfofContext

func (l *ExportLogger) InfofContext(ctx context.Context, format string, args ...interface{})

func (*ExportLogger) Print

func (l *ExportLogger) Print(level Level, args ...interface{})

func (*ExportLogger) PrintContext

func (l *ExportLogger) PrintContext(ctx context.Context, level Level, args ...interface{})

func (*ExportLogger) Printf

func (l *ExportLogger) Printf(level Level, format string, args ...interface{})

func (*ExportLogger) PrintfContext

func (l *ExportLogger) PrintfContext(ctx context.Context, level Level, format string, args ...interface{})

func (*ExportLogger) Warn

func (l *ExportLogger) Warn(args ...interface{})

func (*ExportLogger) WarnContext

func (l *ExportLogger) WarnContext(ctx context.Context, args ...interface{})

func (*ExportLogger) Warnf

func (l *ExportLogger) Warnf(format string, args ...interface{})

func (*ExportLogger) WarnfContext

func (l *ExportLogger) WarnfContext(ctx context.Context, format string, args ...interface{})

type Level

type Level int
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
)

func ParseLevelString

func ParseLevelString(s string) (Level, error)

func (Level) ColorString

func (l Level) ColorString() string

func (Level) LowString

func (l Level) LowString() string

func (Level) MarshalText

func (l Level) MarshalText() ([]byte, error)

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	Print(level Level, args ...interface{})
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Fatal(args ...interface{})
	Printf(level Level, format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	PrintContext(ctx context.Context, level Level, args ...interface{})
	DebugContext(ctx context.Context, args ...interface{})
	InfoContext(ctx context.Context, args ...interface{})
	WarnContext(ctx context.Context, args ...interface{})
	ErrorContext(ctx context.Context, args ...interface{})
	FatalContext(ctx context.Context, args ...interface{})
	PrintfContext(ctx context.Context, level Level, format string, args ...interface{})
	DebugfContext(ctx context.Context, format string, args ...interface{})
	InfofContext(ctx context.Context, format string, args ...interface{})
	WarnfContext(ctx context.Context, format string, args ...interface{})
	ErrorfContext(ctx context.Context, format string, args ...interface{})
	FatalfContext(ctx context.Context, format string, args ...interface{})
	// contains filtered or unexported methods
}
var DefaultLogger Logger

func NewNopLogger

func NewNopLogger() Logger

func NewSimpleLogger

func NewSimpleLogger(writer io.Writer, level Level, disableTimestamp bool, disableColor bool) Logger

type NopLogger

type NopLogger struct {
	Logger
}

func (*NopLogger) SetTimeFunc

func (l *NopLogger) SetTimeFunc(_ func() time.Time)

type SetTimeFuncInterface

type SetTimeFuncInterface interface {
	SetTimeFunc(func() time.Time)
}

type SimpleLogger

type SimpleLogger struct {
	Logger
	// contains filtered or unexported fields
}

func (*SimpleLogger) SetTimeFunc

func (l *SimpleLogger) SetTimeFunc(f func() time.Time)

type TagLogger

type TagLogger struct {
	Logger
	// contains filtered or unexported fields
}

func NewTagLogger

func NewTagLogger(logger Logger, tag string, color aurora.Color) *TagLogger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL