devlog

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Banner(version string, url string, hostFlag string, duration time.Duration)

Banner prints the server startup banner without a timestamp prefix.

func BgGreen

func BgGreen(s string) string

func Blue

func Blue(s string) string

func Bold

func Bold(s string) string

func ClearProgress added in v1.0.0

func ClearProgress()

ClearProgress removes the in-place progress line from the terminal.

func Cyan

func Cyan(s string) string

func Dim

func Dim(s string) string

func DisableProgress added in v1.5.0

func DisableProgress()

DisableProgress turns the in-place progress line off for the rest of the process, e.g. when stdout carries machine-readable output.

func DisplayPath added in v1.5.0

func DisplayPath(p string) string

DisplayPath shortens an absolute path to one relative to the working directory, with forward slashes, so terminals can link it. Relative paths and paths outside the working directory are returned unchanged.

func Error

func Error(tag, format string, args ...any)

Error prints an error log line: "15:04:05 [ERROR] [tag] message"

func FormatLog added in v1.0.0

func FormatLog(tag, msg string) string

FormatLog returns a formatted log line without printing it.

func Green

func Green(s string) string

func Log

func Log(tag, format string, args ...any)

Log prints a tagged info log line: "15:04:05 [tag] message". It does nothing when output is quiet.

func Print added in v1.5.0

func Print(block string)

Print writes a preformatted block (one or more lines), keeping any active progress line intact below it. A missing trailing newline is added.

func Quiet added in v1.5.0

func Quiet() bool

Quiet reports whether informational output is silenced.

func Red

func Red(s string) string

func Request

func Request(method, path string, status int, duration time.Duration)

Request prints an HTTP request log line. Skips /ws and /favicon.ico.

func SetProgress added in v1.0.0

func SetProgress(tag, format string, args ...any)

SetProgress sets (or updates) the in-place progress line. The line is formatted with FormatLog and written with \r (no newline). Concurrent devlog.Log/Warn/Error/Request calls will clear it, write their own line, then redraw it, so interleaving is clean. It does nothing when stderr is not a terminal or output is quiet.

func SetQuiet added in v1.5.0

func SetQuiet(q bool)

SetQuiet silences informational output (Log and the progress line). Warnings and errors still print.

func Warn

func Warn(tag, format string, args ...any)

Warn prints a warning log line: "15:04:05 [WARN] [tag] message"

func WarnCount added in v1.5.0

func WarnCount() int64

WarnCount returns the number of Warn calls made so far in this process. Callers measure a span (such as one build) by taking the difference between two readings.

func Yellow

func Yellow(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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