Documentation
¶
Overview ¶
! Original repository: github.com/MatusOllah/slogcolor
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new Handler with the specified options. If opts is nil, uses DefaultOptions.
type Options ¶
type Options struct {
// Level reports the minimum level to log.
// Levels with lower levels are discarded.
// If nil, the Handler uses [logx.LevelInfo].
Level logx.Leveler
// TimeFormat is the time format.
TimeFormat string
// SrcFileMode is the source file mode.
SrcFileMode SourceFileMode
// SrcFileLength to show fixed length filename to line up the log output, default 0 shows complete filename.
SrcFileLength int
// MsgPrefix to show prefix before message, default: white colored "| ".
MsgPrefix string
// MsgColor is the color of the message, default to empty.
MsgColor *color.Color
// MsgLength to show fixed length message to line up the log output, default 0 shows complete message.
MsgLength int
// NoColor disables color, default: false.
NoColor bool
}
type SourceFileMode ¶
type SourceFileMode int
const ( // Nop does nothing. Nop SourceFileMode = iota // ShortFile produces only the filename (for example main.go:69). ShortFile // LongFile produces the full file path (for example /home/frajer/go/src/myapp/main.go:69). LongFile )
Click to show internal directories.
Click to hide internal directories.