module Jekyll::Algolia::Logger
def self.log(line)
Where X is either I, W or E for marking respectively an info, warning or
"X:Your content"
line - Line to display. Expected to be of the following format:
Public: Displays a log line
def self.log(line) type, content = /^(I|W|E):(.*)/.match(line).captures logger_mapping = { 'E' => :error, 'I' => :info, 'W' => :warn } # Jekyll logger tries to center log lines, so we force a consistent # width of 80 chars content = content.ljust(80, ' ') Jekyll.logger.send(logger_mapping[type], content) end