Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶ added in v0.1.0
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(out io.Writer, opts *HandlerOptions) *Handler
NewHandler creates a Handler that writes to w, using the given options. If opts is nil, the default options are used.
type HandlerOptions ¶
type HandlerOptions struct {
// AddSource causes the handler to compute the source code position
// of the log statement and add a SourceKey attribute to the output.
AddSource bool
// Level reports the minimum record level that will be logged.
// The handler discards records with lower levels.
// If Level is nil, the handler assumes LevelInfo.
// The handler calls Level.Level for each record processed;
// to adjust the minimum level dynamically, use a LevelVar.
Level slog.Leveler
// Disable colorized output
NoColor bool
// TimeFormat is the format used for time.DateTime
TimeFormat string
}
HandlerOptions are options for a ConsoleHandler. A zero HandlerOptions consists entirely of default values.
Click to show internal directories.
Click to hide internal directories.

