Documentation
¶
Index ¶
- func Write(logLevel Level, message any, caller string)
- type Color
- type Level
- type Logger
- func (l *Logger) Log(message ...any)
- func (l *Logger) LogDebug(message any)
- func (l *Logger) LogDebugf(format string, args ...any)
- func (l *Logger) LogError(message any)
- func (l *Logger) LogErrorf(format string, args ...any)
- func (l *Logger) LogEvent(message any)
- func (l *Logger) LogEventf(format string, args ...any)
- func (l *Logger) LogInfo(message any)
- func (l *Logger) LogInfof(format string, args ...any)
- func (l *Logger) LogWarning(message any)
- func (l *Logger) LogWarningf(format string, args ...any)
- func (l *Logger) Logf(format string, args ...any)
- func (l *Logger) SetLevel(level Level)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶ added in v0.0.3
type Logger struct {
Level Level
}
func NewLogger ¶ added in v0.0.3
NewLogger creates a new Logger with the specified log level. The log level is the default level used when calling the Log method. If you want to log a message with a different level, you can use the specific methods for each log level (LogError, LogWarning, LogInfo, LogDebug, LogEvent).
func (*Logger) Log ¶ added in v0.0.3
Log logs a message with the default log level set for the Logger. If you want to log a message with a different level, you can use the specific methods for each log level (LogError, LogWarning, LogInfo, LogDebug, LogEvent). The default log level can be updated with the SetLevel method.
func (*Logger) LogEvent ¶ added in v0.0.3
LogEvent logs a message with the Event log level. Event logs are meant to be used for important events that occur in the application, such as user actions, system events, or other significant occurrences. Event logs are not meant to be used for debugging or informational purposes, but rather to provide a record of important events that can be used for analysis and troubleshooting.
func (*Logger) LogWarning ¶ added in v0.0.3
LogWarning logs a message with the Warning log level.
func (*Logger) LogWarningf ¶ added in v0.0.5
func (*Logger) SetLevel ¶ added in v0.0.3
SetLevel sets the log level for the Logger. This is the default level used when calling the Log method. If you want to log a message with a different level, you can use the specific methods for each log level (LogError, LogWarning, LogInfo, LogDebug, LogEvent).