Documentation
¶
Index ¶
- Constants
- Variables
- func NewMessage(logger *slog.Logger, level slog.Level, context contextpkg.Context) commonlog.Message
- type Backend
- func (self *Backend) AllowLevel(level commonlog.Level, name ...string) bool
- func (self *Backend) Configure(verbosity int, path *string)
- func (self *Backend) GetMaxLevel(name ...string) commonlog.Level
- func (self *Backend) GetWriter() io.Writer
- func (self *Backend) NewMessage(level commonlog.Level, depth int, name ...string) commonlog.Message
- func (self *Backend) SetMaxLevel(level commonlog.Level, name ...string)
- type Message
- type MockHandler
Constants ¶
View Source
const ( LogFileWritePermissions = 0600 DefaultBufferSize = 1_000 )
Variables ¶
View Source
var MOCK_HANDLER = NewMockHandler()
Functions ¶
func NewMessage ¶
Types ¶
type Backend ¶
type Backend struct { Logger *slog.Logger Writer io.Writer BufferSize int Buffered bool AddSource bool // contains filtered or unexported fields }
func NewBackend ¶
func NewBackend() *Backend
func (*Backend) AllowLevel ¶
(commonlog.Backend interface)
func (*Backend) Configure ¶
(commonlog.Backend interface)
func (*Backend) GetMaxLevel ¶
(commonlog.Backend interface)
func (*Backend) GetWriter ¶
(commonlog.Backend interface)
func (*Backend) NewMessage ¶
(commonlog.Backend interface)
func (*Backend) SetMaxLevel ¶
(commonlog.Backend interface)
type MockHandler ¶
type MockHandler struct{}
func NewMockHandler ¶
func NewMockHandler() *MockHandler
func (*MockHandler) Enabled ¶
func (self *MockHandler) Enabled(context contextpkg.Context, level slog.Level) bool
(slog.Handler interface)
func (*MockHandler) Handle ¶
func (self *MockHandler) Handle(context contextpkg.Context, record slog.Record) error
(slog.Handler interface)
func (*MockHandler) WithAttrs ¶
func (self *MockHandler) WithAttrs(attrs []slog.Attr) slog.Handler
(slog.Handler interface)
func (*MockHandler) WithGroup ¶
func (self *MockHandler) WithGroup(name string) slog.Handler
(slog.Handler interface)
Click to show internal directories.
Click to hide internal directories.