Documentation ¶
Index ¶
- Constants
- func Debug(msg string)
- func Debugf(msg string, v ...any)
- func Err(err error)
- func Error(msg string)
- func Errorf(msg string, v ...any)
- func Info(msg string)
- func Infof(msg string, v ...any)
- type Level
- type LogMsg
- type Logger
- func (l *Logger) LogDebug(msg string)
- func (l *Logger) LogDebugf(msg string, v ...any)
- func (l *Logger) LogErr(err error)
- func (l *Logger) LogError(msg string)
- func (l *Logger) LogErrorf(msg string, v ...any)
- func (l *Logger) LogInfo(msg string)
- func (l *Logger) LogInfof(msg string, v ...any)
- func (l *Logger) WithFileToLog(file *os.File) *Logger
- func (l *Logger) WithProgramToLog(program *tea.Program) *Logger
Constants ¶
View Source
const ( INFO = Level("info") ERROR = Level("error") DEBUG = Level("debug") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents application logger.
func NewLogger ¶
NewLogger creates a new logger that logs messages into: - logFile - somewhere in UI, currently in status bar via sending LogMsg to the program
func WithFileToLog ¶
WithFileToLog sets non-nil file as logger output.
func WithProgramToLog ¶
WithProgramToLog sets program where to send log messages.
func (*Logger) LogErr ¶
LogErr finds mapped error message for passed err and logs it in ERROR level.
func (*Logger) WithFileToLog ¶
WithFileToLog sets non-nil file as logger output.
Click to show internal directories.
Click to hide internal directories.