ConsoleReleases

Releases

v1.30.0

Introduce Console::Config for fine grained configuration.

Introduced a new explicit configuration interface via config/console.rb to enhance logging setup in complex applications. This update gives the application code an opportunity to load files if required and control aspects such as log level, output, and more. Users can override default behaviors (e.g., make_output, make_logger, and log_level) for improved customization.

# config/console.rb
def log_level(env = ENV)
	# Set a custom log level, e.g., force debug mode:
	:debug
end

def make_logger(output = $stderr, env = ENV, **options)
	# Custom logger configuration with verbose output:
	options[:verbose] = true
	
	 Logger.new(output, **options)
end

This approach provides a standard way to hook into the log setup process, allowing tailored adjustments for reliable and customizable logging behavior.

v1.29.3

v1.29.2

v1.29.1

v1.29.0

Consistent handling of exceptions.

Console.call and all wrapper methods will now consistently handle exceptions that are the last positional argument or keyword argument. This means that the following code will work as expected:

begin
rescue => error
	# Last positional argument:
	Console.warn(self, "There may be an issue", error)
	
	# Keyword argument (preferable):
	Console.error(self, "There is an issue", exception: error)
end

v1.28.0