module Moft::Logger
Public Class Methods
Public: Print a moft error message to stderr
topic - the topic of the message, e.g. “Configuration file”, “Deprecation”, etc. message - the message detail
Returns nothing
# File lib/moft/logger.rb, line 29 def self.error(topic, message) $stderr.puts message(topic, message).red end
Public: Format the topic
topic - the topic of the message, e.g. “Configuration file”, “Deprecation”, etc.
Returns the formatted topic statement
# File lib/moft/logger.rb, line 48 def self.formatted_topic(topic) "#{topic} ".rjust(20) end
Public: Print a moft message to stdout
topic - the topic of the message, e.g. “Configuration file”, “Deprecation”, etc. message - the message detail
Returns nothing
# File lib/moft/logger.rb, line 9 def self.info(topic, message) $stdout.puts message(topic, message) end
Public: Build a Moft
topic method
topic - the topic of the message, e.g. “Configuration file”, “Deprecation”, etc. message - the message detail
Returns the formatted message
# File lib/moft/logger.rb, line 39 def self.message(topic, message) formatted_topic(topic) + message.gsub(/\s+/, ' ') end
Public: Print a moft message to stderr
topic - the topic of the message, e.g. “Configuration file”, “Deprecation”, etc. message - the message detail
Returns nothing
# File lib/moft/logger.rb, line 19 def self.warn(topic, message) $stderr.puts message(topic, message).yellow end