Documentation ¶
Index ¶
Constants ¶
View Source
const ( FmtReset int = iota FmtBold FmtFaint FmtItalic FmtUnderline FmtBlinkSlow FmtBlinkRapid FmtReverseVideo FmtConcealed FmtCrossedOut )
Base attributes
View Source
const ( FgBlack int = iota + 30 FgRed FgGreen FgYellow FgBlue FgMagenta FgCyan FgWhite )
Foreground colors
View Source
const ( FgHiBlack int = iota + 90 FgHiRed FgHiGreen FgHiYellow FgHiBlue FgHiMagenta FgHiCyan FgHiWhite )
Foreground Hi-Intensity colors
View Source
const ( BgBlack int = iota + 40 BgRed BgGreen BgYellow BgBlue BgMagenta BgCyan BgWhite )
Background colors
View Source
const ( BgHiBlack int = iota + 100 BgHiRed BgHiGreen BgHiYellow BgHiBlue BgHiMagenta BgHiCyan BgHiWhite )
Background Hi-Intensity colors
Variables ¶
View Source
var ( // HandlerOptions contains options for the logger handler. HandlerOptions *slog.HandlerOptions // TimeFormat is the format used for logging timestamps. TimeFormat = "[15:04:05.000]" )
Base config for logger handler, you can override this with your own preferences.
View Source
var ( KeyStatus = "status" KeyDuration = "duration" KeyMethod = "method" KeyPath = "path" KeyDelimiter = "=" FieldOrder = []string{ slog.LevelKey, slog.TimeKey, KeyStatus, KeyDuration, KeyMethod, KeyPath, slog.SourceKey, slog.MessageKey, } )
Some keys with specific format, you can override this with your own preferences.
View Source
var ( FmtLevelDebug = []int{FgHiMagenta} FmtLevelInfo = []int{FgGreen} FmtLevelWarn = []int{FgHiYellow} FmtLevelError = []int{FgHiRed} FmtStatus1XX = []int{FgGreen} FmtStatus2XX = []int{FgGreen} FmtStatus3XX = []int{FgGreen} FmtStatus4XX = []int{FgHiYellow} FmtStatus5XX = []int{FgHiRed} FmtStatusUnknown = []int{FgHiRed} FmtMethodGet = []int{FgGreen} FmtMethodPost = []int{FgYellow} FmtMethodPut = []int{FgBlue} FmtMethodPatch = []int{FgCyan} FmtMethodDelete = []int{FgRed} FmtMethodOther = []int{FgMagenta} FmtTime = []int{FgHiBlack} FmtDuration = []int{FgCyan, FmtItalic} FmtPath = []int{FgHiCyan} FmtMessage = []int{FmtReset} FmtAttrKey = []int{FgBlue} FmtAttrDelimiter = []int{FgHiBlack} FmtAttrValue = []int{FgYellow} )
Format attributes for some keys, you can override this with your own preferences.
View Source
var (
Writer io.Writer
)
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.