class Jekyll::LogAdapter

def abort_with(topic, message = nil, &block)

Returns nothing

message - the message detail (can be omitted)
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

Public: Print an error message and immediately abort the process
def abort_with(topic, message = nil, &block)
  error(topic, message, &block)
  abort
end

def adjust_verbosity(options = {})

def adjust_verbosity(options = {})
  # Quiet always wins.
  if options[:quiet]
    self.log_level = :error
  elsif options[:verbose]
    self.log_level = :debug
  end
  debug "Logging at level:", LOG_LEVELS.key(writer.level).to_s
  debug "Jekyll Version:", Jekyll::VERSION
end

def debug(topic, message = nil, &block)

Returns nothing

message - the message detail
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

Public: Print a debug message
def debug(topic, message = nil, &block)
  write(:debug, topic, message, &block)
end

def error(topic, message = nil, &block)

Returns nothing

message - the message detail
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

Public: Print an error message
def error(topic, message = nil, &block)
  write(:error, topic, message, &block)
end

def formatted_topic(topic, colon = false)

Returns the formatted topic statement

colon -
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

Internal: Format the topic
def formatted_topic(topic, colon = false)
  "#{topic}#{colon ? ": " : " "}".rjust(20)
end

def info(topic, message = nil, &block)

Returns nothing

message - the message detail
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

Public: Print a message
def info(topic, message = nil, &block)
  write(:info, topic, message, &block)
end

def initialize(writer, level = :info)

Returns nothing

log_level - (optional, symbol) the log level
writer - Logger compatible instance

Public: Create a new instance of a log writer
def initialize(writer, level = :info)
  @messages = []
  @writer = writer
  self.log_level = level
end

def log_level=(level)

Returns nothing

level - (symbol) the log level

Public: Set the log level on the writer
def log_level=(level)
  writer.level = level if level.is_a?(Integer) && level.between?(0, 3)
  writer.level = LOG_LEVELS[level] ||
    raise(ArgumentError, "unknown log level")
  @level = level
end

def message(topic, message = nil)

Returns the formatted message

message - the message detail
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

Internal: Build a topic method
def message(topic, message = nil)
  raise ArgumentError, "block or message, not both" if block_given? && message
  message = yield if block_given?
  message = message.to_s.gsub(%r!\s+!, " ")
  topic = formatted_topic(topic, block_given?)
  out = topic + message
  messages << out
  out
end

def warn(topic, message = nil, &block)

Returns nothing

message - the message detail
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

Public: Print a message
def warn(topic, message = nil, &block)
  write(:warn, topic, message, &block)
end

def write(level_of_message, topic, message = nil, &block)

the appropriate writer method, e.g. writer.info.
Returns false if the message was not written, otherwise returns the value of calling

block - a block containing the message (optional)
message - the String message (optional)
topic - the String topic or full message
level_of_message - the Symbol level of message, one of :debug, :info, :warn, :error

Internal: Log a message.
def write(level_of_message, topic, message = nil, &block)
  return false unless write_message?(level_of_message)
  writer.public_send(level_of_message, message(topic, message, &block))
end

def write_message?(level_of_message)

Returns whether the message should be written.

level_of_message - the Symbol level of message, one of :debug, :info, :warn, :error

Internal: Check if the message should be written given the log level.
def write_message?(level_of_message)
  LOG_LEVELS.fetch(level) <= LOG_LEVELS.fetch(level_of_message)
end