Documentation
¶
Index ¶
- Variables
- func ArchiveLogs(archiveLogs bool)
- func Close()
- func Debugf(format string, a ...any)
- func DoesLogArchives() bool
- func Error(err error)
- func Errorf(format string, a ...any)
- func FatalErr(err error)
- func Fatalf(format string, a ...any)
- func Infof(format string, a ...any)
- func SetDir(logDir string)
- func SetLevel(level LogLevel)
- func Tracef(format string, a ...any)
- func Warnf(format string, a ...any)
- func WriteLogFile(writeLog bool)
- type Config
- type LogLevel
- type LogType
- type Logger
- func (logger *Logger) ArchiveCurrentLog() error
- func (logger *Logger) ArchiveLogs(archiveLogs bool)
- func (logger *Logger) Close()
- func (logger *Logger) Debugf(format string, a ...any)
- func (logger *Logger) DoesLogArchives() bool
- func (logger *Logger) Error(err error)
- func (logger *Logger) Errorf(format string, a ...any)
- func (logger *Logger) FatalErr(err error)
- func (logger *Logger) Fatalf(format string, a ...any)
- func (logger *Logger) File() *os.File
- func (logger *Logger) GetLevel() LogLevel
- func (logger *Logger) Infof(format string, a ...any)
- func (logger *Logger) Logf(level LogLevel, format string, a ...any)
- func (logger *Logger) SetDir(logDir string)
- func (logger *Logger) SetLevel(level LogLevel)
- func (logger *Logger) Tracef(format string, a ...any)
- func (logger *Logger) Warnf(format string, a ...any)
- func (logger *Logger) Write(p []byte) (n int, err error)
- func (logger *Logger) WriteLog(message string, level LogLevel)
- func (logger *Logger) WriteLogFile(writeLog bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var LOG_PREFIX = [NUM_LOG_LEVELS]string{"D", "T", "I", "W", "E", "F"}
Functions ¶
func ArchiveLogs ¶
func ArchiveLogs(archiveLogs bool)
func DoesLogArchives ¶
func DoesLogArchives() bool
func WriteLogFile ¶
func WriteLogFile(writeLog bool)
Types ¶
type Config ¶
type Config struct { // If the len(Title) > 0, the title will be prepended before message content Label string // Lowest log level that can be handled Level LogLevel // The number of callstack frames to skip. This would be the argument passed to runtime.Caller(skip int) // By default, this is 1 such that the Trace will log where the statement was executed TraceSkip int // Enables/disabled writing the current log to a file. The contents of the log file is overwritten // during the first Logger.Write(). If ArchiveLogs is true, this option is ignored WriteLogFile bool // Enables/disables log archiving ArchiveLogs bool // If File is nil, it will default to os.Stdout File *os.File }
type Logger ¶
func (*Logger) ArchiveCurrentLog ¶
func (*Logger) ArchiveLogs ¶
func (*Logger) DoesLogArchives ¶
func (*Logger) WriteLogFile ¶
Click to show internal directories.
Click to hide internal directories.