Module: Async::Console

Defined in:
lib/async/console.rb

Overview

Shims for the console gem, redirecting warnings and above to ‘Kernel#warn`.

If you require this file, the ‘async` library will not depend on the `console` gem.

That includes any gems that sit within the ‘Async` namespace.

This is an experimental feature.

Class Method Summary collapse

Class Method Details

.debugObject

Log a message at the debug level. The shim is silent.



16
17
# File 'lib/async/console.rb', line 16

def self.debug(...)
end

.errorObject

Log a message at the error level. The shim redirects to ‘Kernel#warn`.



33
34
35
# File 'lib/async/console.rb', line 33

def self.error(...)
	self.warn(...)
end

.fatalObject

Log a message at the fatal level. The shim redirects to ‘Kernel#warn`.



38
39
40
# File 'lib/async/console.rb', line 38

def self.fatal(...)
	self.warn(...)
end

.infoObject

Log a message at the info level. The shim is silent.



20
21
# File 'lib/async/console.rb', line 20

def self.info(...)
end

.warn(*arguments, exception: nil, **options) ⇒ Object

Log a message at the warn level. The shim redirects to ‘Kernel#warn`.



24
25
26
27
28
29
30
# File 'lib/async/console.rb', line 24

def self.warn(*arguments, exception: nil, **options)
	if exception
		super(*arguments, exception.full_message, **options)
	else
		super(*arguments, **options)
	end
end