Method: YARD::Logger#capture

Defined in:
lib/yard/logging.rb

#capture(msg, nontty_log = :debug) { ... } ⇒ void

TODO:

Implement capture storage for reporting of benchmarks

This method returns an undefined value.

Captures the duration of a block of code for benchmark analysis. Also calls #progress on the message to display it to the user.

Parameters:

  • msg (String)

    the message to display

  • nontty_log (Symbol, nil) (defaults to: :debug)

    the level to log as if the output stream is not a TTY. Use nil for no alternate logging.

Yields:

  • a block of arbitrary code to benchmark



80
81
82
83
84
85
# File 'lib/yard/logging.rb', line 80

def capture(msg, nontty_log = :debug)
  progress(msg, nontty_log)
  yield
ensure
  clear_progress
end