Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config func(*TelegramHook)
Config defines a method for additional configuration when instantiating TelegramHook
func WithMinLevel ¶
func WithTimeout ¶
WithTimeout sets http call timeout for telegram client
type TelegramHook ¶
type TelegramHook struct { AppName string // contains filtered or unexported fields }
TelegramHook to send logs via the Telegram API.
func NewTelegramHook ¶
func NewTelegramHook(appName, authToken, targetID string, config ...Config) (*TelegramHook, error)
NewTelegramHook creates a new instance of a hook targeting the Telegram API.
func NewTelegramHookWithClient ¶
func NewTelegramHookWithClient(appName, authToken, targetID string, client *http.Client, config ...Config) (*TelegramHook, error)
NewTelegramHookWithClient NewTelegramHook creates a new instance of a hook targeting the Telegram API with custom http.Client.
func (*TelegramHook) Fire ¶
func (hook *TelegramHook) Fire(entry *logrus.Entry) error
Fire emits a log message to the Telegram API.
func (*TelegramHook) Levels ¶
func (hook *TelegramHook) Levels() []logrus.Level
Levels returns the log levels that the hook should be enabled for.
Click to show internal directories.
Click to hide internal directories.