Class LogHelper

java.lang.Object
com.github.jknack.handlebars.helper.LogHelper
All Implemented Interfaces:
Helper<Object>

public class LogHelper extends Object implements Helper<Object>
Log a message. Usage:
 {{log "Look at me!" }}

 {{log "This is logged" foo "And so is this"}}

 {{log "Log!" level="error"}}

 {{#log}}
  Hi {{name}}!
 {{/log}}
 
Since:
4.0.1
  • Field Details

  • Constructor Details

    • LogHelper

      public LogHelper()
  • Method Details

    • apply

      public Object apply(Object context, Options options) throws IOException
      Description copied from interface: Helper
      Apply the helper to the context.
      Specified by:
      apply in interface Helper<Object>
      Parameters:
      context - The context object.
      options - The options object.
      Returns:
      A string result.
      Throws:
      IOException - If a template cannot be loaded.