logger

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

opsmaster/internal/logger/logger.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *slog.Logger

Get retorna uma instância pré-configurada do logger slog com um formato customizado.

Types

type CustomTextHandler

type CustomTextHandler struct {
	// contains filtered or unexported fields
}

CustomTextHandler é o nosso handler customizado que envolve o TextHandler padrão.

func (*CustomTextHandler) Enabled

func (h *CustomTextHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*CustomTextHandler) Handle

func (h *CustomTextHandler) Handle(ctx context.Context, r slog.Record) error

Handle é o método que formata cada entrada de log.

func (*CustomTextHandler) WithAttrs

func (h *CustomTextHandler) WithAttrs(attrs []slog.Attr) slog.Handler

WithAttrs e WithGroup são necessários para implementar a interface slog.Handler.

func (*CustomTextHandler) WithGroup

func (h *CustomTextHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL