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

internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// slog does not define trace and fatal levels, so we define them here.
	LevelTrace = slog.LevelDebug - 4
	LevelDebug = slog.LevelDebug
	LevelInfo  = slog.LevelInfo
	LevelWarn  = slog.LevelWarn
	LevelError = slog.LevelError
	LevelFatal = slog.LevelError + 4
	LevelPanic = slog.LevelError + 8

	Disable = slog.LevelInfo + 1000 // A level that disables logging, used for testing or no-op logger.
)

Variables

This section is empty.

Functions

func FormatLogLevel

func FormatLogLevel(level slog.Level) string

func NoOpLogger

func NoOpLogger() *slog.Logger

NoOpLogger returns a no-op logger that does not log anything.

func ParseLogLevel

func ParseLogLevel(level string) (slog.Level, error)

ParseLogLevel parses a string representation of a log level and returns the corresponding slog.Level. If the level is not recognized, it returns LevelInfo.

Types

type FileWatcher

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

FileWatcher watches a file for changes and calls a callback function when the file is modified.

func NewFileWatcher

func NewFileWatcher(path string, callback func()) *FileWatcher

NewFileWatcher creates a new file watcher for the given path and callback function.

func (*FileWatcher) Close

func (fw *FileWatcher) Close() error

func (*FileWatcher) Start

func (fw *FileWatcher) Start() error

Jump to

Keyboard shortcuts

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