class NoirLogger
- NoirLogger
- Reference
- Object
Defined in:
models/logger.crConstant Summary
-
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 thanLibC.usleep, which would block the whole scheduler now that the spinner is a fiber.
Constructors
Class Method Summary
-
.broken_pipe?(ex : IO::Error) : Bool
IO::Error#os_errorisErrno | WinError | WasiError | Nil— on Windows a broken pipe surfaces as aWinError, not anErrno, so comparing straight againstErrno::EPIPEsilently never matches there.
Instance Method Summary
- #debug(message)
-
#debug(&) : Nil
Block form for messages that cost something to build.
- #debug_sub(message)
- #error(message)
- #fatal(message)
- #heading(message)
- #info(message)
- #loading(message : String, &)
- #log(level : LogLevel, message : String)
- #puts(message)
- #puts_sub(message)
- #sub(message)
- #success(message)
- #verbose(message)
- #verbose_sub(message)
- #warning(message)
Constructor Detail
Class Method Detail
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.
Instance Method Detail
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.