birch/handler/console

Console handler for log output.

Writes log messages to stdout or stderr, with optional color support.

Types

ANSI color codes for terminal output.

pub type Color {
  Reset
  Red
  Yellow
  Blue
  Cyan
  Gray
  BrightRed
}

Constructors

  • Reset
  • Red
  • Yellow
  • Blue
  • Cyan
  • Gray
  • BrightRed

Console handler configuration.

pub type ConsoleConfig {
  ConsoleConfig(color: Bool, target: handler.OutputTarget)
}

Constructors

  • ConsoleConfig(color: Bool, target: handler.OutputTarget)

    Arguments

    color

    Whether to use colors (if terminal supports it)

    target

    Output target (stdout, stderr, or split)

Values

pub fn default_config() -> ConsoleConfig

Default console configuration.

pub fn handler() -> handler.Handler

Create a console handler with default settings. Uses human-readable format, colors if TTY, outputs to stdout.

pub fn handler_with_config(
  config: ConsoleConfig,
) -> handler.Handler

Create a console handler with custom configuration.

Search Document