Skip to main content

Module log

Module log 

Source
Expand description

Verbose logging (zx log) and the command highlighter (zx formatCmd).

Entries are written only when they are verbose. Colors follow zx: the command name is bright green, operators red, quoted strings bright yellow and shell keywords bright cyan. format_cmd always colors (like zx with a forced color level); Logger::stderr enables colors only when stderr is a terminal and NO_COLOR is unset.

Structs§

Logger
Writes verbose LogEntry records to an output (zx log).

Enums§

LogEntry
A log record (zx LogEntry).

Functions§

format_cmd
Render a command as zx prints it in verbose mode ($ cmd, continuation lines prefixed with > ), with ANSI colors.
format_cmd_plain
Like format_cmd without colors.
format_entry
The default rendering of entry (empty for end and kill).
log
Log entry to stderr when verbose is set (errors are ignored).

Type Aliases§

Formatter
A custom renderer registered with Logger::formatter.