Help us shape the future of Go! Take the 2026 Go Developer Survey

handlerdev

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

! Original repository: github.com/golang-cz/devslog

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(out io.Writer, o *Options) *developHandler

Types

type Color

type Color uint
const (
	UnknownColor Color = iota
	Black
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

type Options

type Options struct {
	// You can use standard logx.HandlerOptions, that would be used in production
	*logx.HandlerOptions

	// Max number of printed elements in slice.
	MaxSlicePrintSize uint

	// If the attributes should be sorted by keys
	SortKeys bool

	// Time format for timestamp, default format is "[15:04:05]"
	TimeFormat string

	// Add blank line after each log
	NewLineAfterLog bool

	// Indent \n in strings
	StringIndentation bool

	// Set color for Debug level, default: devlogx.Blue
	DebugColor Color

	// Set color for Info level, default: devlogx.Green
	InfoColor Color

	// Set color for Warn level, default: devlogx.Yellow
	WarnColor Color

	// Set color for Error level, default: devlogx.Red
	ErrorColor Color

	// Max stack trace frames when unwrapping errors
	MaxErrorStackTrace uint

	// Use method String() for formatting value
	StringerFormatter bool

	// Disable coloring
	NoColor bool

	// Keep same color for whole source info, helpful when you want to open the line of code from terminal, but the ANSI coloring codes are in link itself
	SameSourceInfoColor bool
}

Jump to

Keyboard shortcuts

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