class

NoirLogger

Inherits Reference < Object

Constants

SHIMMER_BAND_RADIUS = SHIMMER_COLORS.size - 1
SHIMMER_COLORS = [159, 255, 250, 247, 245]
SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
SPINNER_INTERVAL = 60.milliseconds

Frame delay. sleep (fiber-aware) rather than LibC.usleep, which would block the whole scheduler now that the spinner is a fiber.

Constructors

new(debug : Bool, verbose : Bool, colorize : Bool, no_log : Bool, no_spinner : Bool = false)
Source

Class methods

broken_pipe?(ex : IO::Error) : Bool

IO::Error#os_error is Errno | WinError | WasiError | Nil — on Windows a broken pipe surfaces as a WinError, not an Errno, so comparing straight against Errno::EPIPE silently never matches there. WinError#to_errno normalizes it (ERROR_BROKEN_PIPE / ERROR_NO_DATA both map to Errno::EPIPE). Noir doesn't ship a WASI build, so WasiError — whose own #to_errno doesn't even compile on every native target (it references an Errno member some platforms' bindings omit) — is intentionally left out of this check.

Source

Instance methods

debug(message)
Source
debug

Block form for messages that cost something to build. The message overload takes an already-built String, so debug "...#{expensive}" pays for the interpolation on every call and then throws it away with debug off; debug { "...#{expensive}" } doesn't build it at all.

Source
debug_sub(message)
Source
error(message)
Source
fatal(message)
Source
heading(message)
Source
info(message)
Source
loading(message : String, &)
Source
log(level : LogLevel, message : String)
Source
puts(message)
Source
puts_sub(message)
Source
sub(message)
Source
success(message)
Source
verbose(message)
Source
verbose_sub(message)
Source
warning(message)
Source

Nested types