Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLevelColors = LevelColors{
Debug: 10170623,
Info: 3581519,
Warn: 14327864,
Error: 13631488,
Panic: 13631488,
Fatal: 13631488,
}
DefaultLevelColors is a struct of the default colors used
Functions ¶
Types ¶
type Hook ¶
type Hook struct { // WebhookURL is the full Discord webhook URL WebhookURL string // MinLevel is the minimum priority level to enable logging for MinLevel logrus.Level // Opts contains the options available for the hook Opts *Opts }
Hook is a hook to send logs to Discord
type LevelColors ¶
LevelColors is a struct of the possible colors used in Discord color format (0x[RGB] converted to int)
func (LevelColors) LevelColor ¶
func (lc LevelColors) LevelColor(l logrus.Level) int
LevelColor returns the respective color for the logrus level
type Opts ¶
type Opts struct { // Username replaces the default username of the webhook bot for the sent message only if set (default: none) Username string // Author adds an author field if set (default: none) Author string // DisableInlineFields causes fields to be displayed one per line as opposed to being inline (i.e., in columns) (default: false) DisableInlineFields bool // EnableCustomColors specifies whether CustomLevelColors should be used instead of DefaultLevelColors (default: true) EnableCustomColors bool // CustomLevelColors is a LevelColors struct which replaces DefaultLevelColors if EnableCustomColors is set to true (default: none) CustomLevelColors *LevelColors // DisableTimestamp specifies whether the timestamp in the footer should be disabled (default: false) DisableTimestamp bool // TimestampFormat specifies a custom format for the footer TimestampFormat string // TimestampLocale specifies a custom locale for the timestamp TimestampLocale *time.Location }
Opts contains the options available for the hook
Click to show internal directories.
Click to hide internal directories.