Documentation
¶
Overview ¶
Package log provides context-aware logging for wt.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides output and verbose command logging.
func FromContext ¶
FromContext retrieves the logger from context. Returns a no-op logger if none is attached.
func (*Logger) Command ¶
Command returns a function that logs an external command execution with duration. Call the returned function after the command completes. Only prints when verbose mode is enabled and quiet mode is disabled. If dir is non-empty, it's shown as a prefix: [dir] $ cmd args (duration)
func (*Logger) Debug ¶ added in v0.13.0
Debug logs a debug message with key-value pairs. Only prints when verbose mode is enabled and quiet mode is disabled.
func (*Logger) IsVerbose ¶ added in v0.19.1
IsVerbose returns true if the logger is in verbose mode (and not quiet).