Public: Create a new instance of Stevenson, Jekyll's logger
level - (optional, integer) the log level
Returns nothing
# File lib/jekyll/stevenson.rb, line 15 def initialize(level = INFO) @log_level = level end
Public: Print a jekyll error message to stderr
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc. message - the message detail
Returns nothing
# File lib/jekyll/stevenson.rb, line 45 def error(topic, message) $stderr.puts(message(topic, message).red) if log_level <= ERROR end
Public: Format the topic
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.
Returns the formatted topic statement
# File lib/jekyll/stevenson.rb, line 64 def formatted_topic(topic) "#{topic} ".rjust(20) end
Public: Print a jekyll message to stdout
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc. message - the message detail
Returns nothing
# File lib/jekyll/stevenson.rb, line 25 def info(topic, message) $stdout.puts(message(topic, message)) if log_level <= INFO end
Public: Build a Jekyll topic method
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc. message - the message detail
Returns the formatted message
# File lib/jekyll/stevenson.rb, line 55 def message(topic, message) formatted_topic(topic) + message.gsub(/\s+/, ' ') end
Public: Print a jekyll message to stderr
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc. message - the message detail
Returns nothing
# File lib/jekyll/stevenson.rb, line 35 def warn(topic, message) $stderr.puts(message(topic, message).yellow) if log_level <= WARN end
Generated with the Darkfish Rdoc Generator 2.