Class: TTY::Spinner

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/tty-spinner_log.rb

Instance Method Summary collapse

Instance Method Details

#log(message) ⇒ Object

Log a message to the output This will clear the current spinner line, print the log message, and then redraw or resume the spinner on a new line.

Parameters:

  • message (String)

    the log message to print



17
18
19
20
21
22
23
# File 'lib/core_ext/tty-spinner_log.rb', line 17

def log(message)
  synchronize do
    clear_line    # Clear the spinner
    output.puts(message) # Log the message
    redraw_indent # Redraw the spinner frame
  end
end