Class YARD::Logger
In: lib/yard/logging.rb
Parent: ::Logger

Handles console logging for info, warnings and errors. Uses the stdlib Logger class in Ruby for all the backend logic.

Methods

Constants

PROGRESS_INDICATORS = ["\u230C", "\u230D", "\u230E", "\u230F"]   The list of characters displayed beside the progress bar to indicate "movement". @since 0.8.2

Attributes

io  [RW]  @return [IO] the IO object being logged to @since 0.8.2
show_backtraces  [W] 
show_progress  [W] 

Public Class methods

The logger instance @return [Logger] the logger instance

Creates a new logger

Public Instance methods

Prints the backtrace exc to the logger as error data.

@param [Array<String>] exc the backtrace list @param [Symbol] level_meth the level to log backtrace at @return [void]

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

@todo Implement capture storage for reporting of benchmarks @param [String] msg the message to display @param [Symbol, nil] nontty_log the level to log as if the output

  stream is not a TTY. Use +nil+ for no alternate logging.

@yield a block of arbitrary code to benchmark @return [void]

Clears the progress indicator in the TTY display. @return [void] @since 0.8.2

Changes the debug level to DEBUG if $DEBUG is set and writes a debugging message.

Sets the logger level for the duration of the block

@example

  log.enter_level(Logger::ERROR) do
    YARD.parse_string "def x; end"
  end

@param [Fixnum] new_level the logger level for the duration of the block.

  values can be found in Ruby's Logger class.

@yield the block with the logger temporarily set to new_level

Displays a progress indicator for a given message. This progress report is only displayed on TTY displays, otherwise the message is passed to the nontty_log level.

@param [String] msg the message to log @param [Symbol, nil] nontty_log the level to log as if the output

  stream is not a TTY. Use +nil+ for no alternate logging.

@return [void] @since 0.8.2

Displays an unformatted line to the logger output stream. Similar to the +#<<+ method, but adds a newline. @param [String] msg the message to display @return [void] @since 0.8.2

@return [Boolean] whether backtraces should be shown (by default

  this is on).

@return [Boolean] whether progress indicators should be shown when

  logging CLIs (by default this is off).

Warns that the Ruby environment does not support continuations. Applies to JRuby, Rubinius and MacRuby. This warning will only display once per Ruby process.

@deprecated Continuations are no longer needed by YARD 0.8.0+. @return [void]

[Validate]