Documentation ¶
Index ¶
- Constants
- type LoggerParams
- type SlcErr
- type SlcLogger
- func (s *SlcLogger) Debug(message interface{}, title ...string) error
- func (s *SlcLogger) Error(message interface{}, title ...string) error
- func (s *SlcLogger) Info(message interface{}, title ...string) error
- func (s *SlcLogger) SetLogLevel(level logLevel)
- func (s *SlcLogger) Warn(message interface{}, title ...string) error
Constants ¶
View Source
const ( LevelDebug logLevel = iota + 1 LevelInfo LevelWarn LevelError )
LogLevel Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoggerParams ¶
type LoggerParams struct { WebHookURL string LogLevel logLevel DefaultChannel string DebugChannel string InfoChannel string WarnChannel string ErrorChannel string UserName string DefaultTitle string IconURL string }
LoggerParams is the set of parameters that can be used when creating a new SlcLogger.
type SlcLogger ¶
type SlcLogger struct { WebHookURL string LoggerParams LogLevel logLevel DebugChannel string InfoChannel string WarnChannel string ErrorChannel string UserName string DefaultTitle string IconURL string }
SlcLogger is the structure detailing logger.
func NewSlcLogger ¶
func NewSlcLogger(params *LoggerParams) (*SlcLogger, error)
NewSlcLogger returns a new SLcLogger.
func (*SlcLogger) Debug ¶
Debug is a wrapper function of sendNotification function that implicitly sets the logLevel and color.
func (*SlcLogger) Error ¶
Error is a wrapper function of sendNotification function that implicitly sets the logLevel and color.
func (*SlcLogger) Info ¶
Info is a wrapper function of sendNotification function that implicitly sets the logLevel and color.
func (*SlcLogger) SetLogLevel ¶
func (s *SlcLogger) SetLogLevel(level logLevel)
SetLogLevel sets a logLevel to SlcLogger.LogLevel.
Click to show internal directories.
Click to hide internal directories.