Class: Jekyll::Stevenson

### Home Classes Methods

### In Files

- lib/jekyll/stevenson.rb

### Parent

Object

### Methods

- ::new
- #abort_with
- #debug
- #error
- #formatted_topic
- #info
- #message
- #warn

### Files

- LICENSE

### Class/Module Index

Quicksearch

- Jekyll
- Jekyll::Command
- Jekyll::Commands
- Jekyll::Commands::Build
- Jekyll::Commands::Doctor
- Jekyll::Commands::New
- Jekyll::Commands::Serve
- Jekyll::Configuration
- Jekyll::Converter
- Jekyll::Converters
- Jekyll::Converters::Identity
- Jekyll::Converters::Markdown
- Jekyll::Converters::Markdown::KramdownParser
- Jekyll::Converters::Markdown::MarukuParser
- Jekyll::Converters::Markdown::RDiscountParser
- Jekyll::Converters::Markdown::RedcarpetParser
- Jekyll::Converters::Markdown::RedcarpetParser::CommonMethods
- Jekyll::Converters::Markdown::RedcarpetParser::WithPygments
- Jekyll::Converters::Markdown::RedcarpetParser::WithoutPygments
- Jekyll::Converters::Textile
- Jekyll::Convertible
- Jekyll::Deprecator
- Jekyll::Draft
- Jekyll::Excerpt
- Jekyll::FatalException
- Jekyll::Filters
- Jekyll::Generator
- Jekyll::Generators
- Jekyll::Generators::Pagination
- Jekyll::GistTag
- Jekyll::Layout
- Jekyll::Page
- Jekyll::Pager
- Jekyll::Plugin
- Jekyll::Post
- Jekyll::RelatedPosts
- Jekyll::Site
- Jekyll::Site::Cleaner
- Jekyll::StaticFile
- Jekyll::Stevenson
- Jekyll::Tags
- Jekyll::Tags::HighlightBlock
- Jekyll::Tags::IncludeTag
- Jekyll::Tags::PostComparer
- Jekyll::Tags::PostUrl
- Jekyll::URL
- Date
- Enumerable
- Hash
- Object

No matching classes.

# Jekyll::Stevenson

### Constants

DEBUG
ERROR
INFO
WARN

### Attributes

log_level[RW]

### Public Class Methods

new(level = INFO) click to toggle source

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 Instance Methods

abort_with(topic, message = nil) click to toggle source

Public: Print a Jekyll error message to stderr and immediately abort the process

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

Returns nothing

    # File lib/jekyll/stevenson.rb, line 65
    def abort_with(topic, message = nil)
      error(topic, message)
      abort
    end

debug(topic, message = nil) click to toggle source

Public: Print a jekyll debug 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 debug(topic, message = nil)
      $stdout.puts(message(topic, message)) if log_level <= DEBUG
    end

error(topic, message = nil) click to toggle source

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 55
    def error(topic, message = nil)
      $stderr.puts(message(topic, message).red) if log_level <= ERROR
    end

formatted_topic(topic) click to toggle source

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 85
    def formatted_topic(topic)
      "#{topic} ".rjust(20)
    end

info(topic, message = nil) click to toggle source

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 35
    def info(topic, message = nil)
      $stdout.puts(message(topic, message)) if log_level <= INFO
    end

message(topic, message) click to toggle source

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 76
    def message(topic, message)
      formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ')
    end

warn(topic, message = nil) click to toggle source

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 45
    def warn(topic, message = nil)
      $stderr.puts(message(topic, message).yellow) if log_level <= WARN
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.