logging

package
v0.0.0-...-f1f8829 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func NewLogger

func NewLogger(filePath string) (*Logger, error)

func (*Logger) CloseFile

func (l *Logger) CloseFile()

func (*Logger) Debug

func (l *Logger) Debug(msg string)

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) SetCustomLogger

func (l *Logger) SetCustomLogger(customLogger *slog.Logger)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level slog.Level)

func (*Logger) Warn

func (l *Logger) Warn(msg string)

type LoggerInterface

type LoggerInterface interface {
	Info(msg string)
	Debug(msg string)
	Warn(msg string)
	Error(msg string)
	SetLevel(level slog.Level)
	CloseFile()
}

type MockLogger

type MockLogger struct {
	Messages []string
}

func NewMockLogger

func NewMockLogger() *MockLogger

func (*MockLogger) CloseFile

func (m *MockLogger) CloseFile()

func (*MockLogger) Debug

func (m *MockLogger) Debug(msg string)

func (*MockLogger) Error

func (m *MockLogger) Error(msg string)

func (*MockLogger) Info

func (m *MockLogger) Info(msg string)

func (*MockLogger) SetLevel

func (m *MockLogger) SetLevel(level slog.Level)

func (*MockLogger) Warn

func (m *MockLogger) Warn(msg string)

Jump to

Keyboard shortcuts

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