Documentation ¶
Index ¶
- Variables
- func DefaultConverter(addSource bool, replaceAttr func(groups []string, a slog.Attr) slog.Attr, ...) string
- type Converter
- type MicrosoftTeamsHandler
- func (h *MicrosoftTeamsHandler) Enabled(_ context.Context, level slog.Level) bool
- func (h *MicrosoftTeamsHandler) Handle(ctx context.Context, record slog.Record) error
- func (h *MicrosoftTeamsHandler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *MicrosoftTeamsHandler) WithGroup(name string) slog.Handler
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ColorMapping = map[slog.Level]string{ slog.LevelDebug: "#63C5DA", slog.LevelInfo: "#63C5DA", slog.LevelWarn: "#FFA500", slog.LevelError: "#FF0000", }
View Source
var SourceKey = "source"
Functions ¶
Types ¶
type MicrosoftTeamsHandler ¶
type MicrosoftTeamsHandler struct {
// contains filtered or unexported fields
}
type Option ¶
type Option struct { // log level (default: debug) Level slog.Leveler // Teams webhook url WebhookURL string Timeout time.Duration // default: 10s // optional: customize Teams event builder Converter Converter // optional: see slog.HandlerOptions AddSource bool ReplaceAttr func(groups []string, a slog.Attr) slog.Attr }
func (Option) NewMicrosoftTeamsHandler ¶
Click to show internal directories.
Click to hide internal directories.