module Warn
Redirect warnings to Console.warn.
Definitions
def warn(message, **options)
Redirect warnings to Console.warn
.
Implementation
def warn(message, **options)
fiber = Fiber.current
# We do this to be extra pendantic about avoiding infinite recursion.
return super if fiber.console_warn
begin
fiber.console_warn = true
message.chomp!
Console::Logger.instance.warn(message, **options)
ensure
fiber.console_warn = false
end
end