Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow yield to logger methods & bail early on no-op messages #6315

Merged
merged 5 commits into from Aug 18, 2017

Commits on Aug 18, 2017

  1. Add the ability to yield a message.

    Standard loggers in Ruby mostly `yield` their messages (this is the default behavior of Ruby's own logger.) Or if there is a block then the message is the topic, a colon is automatically added, and the message is shipped with the topic.  Jekyll should conform to this behavior so that it's logger can be passed to libraries that expect this standard behavior.
    
    ```ruby
    [1] pry(main)> Jekyll.logger.info("Just so you know") # => Just so you know
    [2] pry(main)> Jekyll.logger.info("Just so you know", "this is a message") # => Just so you know this is a message
    [3] pry(main)> Jekyll.logger.info("Just so you know") { "this is a message" }
      # => Just so you know: this is a message
    ```
    
    Signed-off-by: Parker Moore <parkrmoore@gmail.com>
    Jordon Bedwell authored and parkr committed Aug 18, 2017
    Copy the full SHA
    2dd641f View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    fcbb3dd View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    4801a5e View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    9737908 View commit details
    Browse the repository at this point in the history
  5. Only log at :error by default

    parkr committed Aug 18, 2017
    Copy the full SHA
    a1ecdf0 View commit details
    Browse the repository at this point in the history