libero/ws_logger

Logger type used by generated WebSocket handlers.

Consumers pass a Logger value into ws.upgrade so the generated handler can emit structured log messages without libero needing to know about any particular logging backend.

Types

pub type Logger {
  Logger(
    debug: fn(String) -> Nil,
    warning: fn(String) -> Nil,
    error: fn(String) -> Nil,
  )
}

Constructors

  • Logger(
      debug: fn(String) -> Nil,
      warning: fn(String) -> Nil,
      error: fn(String) -> Nil,
    )

Values

pub fn default_logger() -> Logger

Default logger that prints everything to stdout via io.println. Suitable for examples and local development; replace with a real structured logger in production code.

Search Document