Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFilesWriter ¶ added in v0.1.0
NewFilesWriter creates a new rolling files writer. It rotates the log file when it reaches a certain size, age...
Types ¶
type BarkWriter ¶ added in v0.0.7
type BarkWriter struct {
// contains filtered or unexported fields
}
BarkWriter is a writer that sends log messages to Bark.
func NewBark ¶ added in v0.0.7
func NewBark(token string) *BarkWriter
NewBark creates a new BarkWriter instance with the given token.
type NewRelicWriter ¶ added in v0.0.7
type NewRelicWriter struct {
// contains filtered or unexported fields
}
NewRelicWriter is a writer that sends log messages to NewRelic.
func NewRelic ¶ added in v0.0.7
func NewRelic(key string) *NewRelicWriter
NewRelic creates a new NewRelicWriter with the given API key.
type TelegramWriter ¶ added in v0.0.7
type TelegramWriter struct {
// contains filtered or unexported fields
}
TelegramWriter is a writer that sends log messages to Telegram by using Bot API.
func NewTelegram ¶ added in v0.0.7
func NewTelegram(token string) *TelegramWriter
NewTelegram creates new TelegramWriter instance with the given token.
func (*TelegramWriter) SetChatID ¶ added in v0.0.7
func (th *TelegramWriter) SetChatID(chatID any)
SetChatID sets `chat_id` field in JSON payload sent to Telegram API.
func (*TelegramWriter) Write ¶ added in v0.0.7
func (th *TelegramWriter) Write(msg []byte) (n int, err error)
Write sends the log message to Telegram Bot API, it implements the io.Writer interface. It is called by the log/slog package when a log message is written.