Module: Ronin::Core::CLI::Logging

Includes:
CommandKit::Colors
Defined in:
lib/ronin/core/cli/logging.rb

Overview

Helper methods for printing log messages.

Instance Method Summary collapse

Instance Method Details

#log_error(message) ⇒ Object

Prints an error message to STDERR.

Parameters:

  • message (String)

    The message to print.



56
57
58
# File 'lib/ronin/core/cli/logging.rb', line 56

def log_error(message)
  stderr.puts("#{colors(stderr).bold(colors(stderr).bright_red('!!!'))} #{colors(stderr).bold(colors(stderr).red(message))}")
end

#log_info(message) ⇒ Object

Prints an info message to STDOUT.

Parameters:

  • message (String)

    The message to print.



36
37
38
# File 'lib/ronin/core/cli/logging.rb', line 36

def log_info(message)
  puts("#{colors.bold(colors.bright_green('>>>'))} #{colors.bold(colors.white(message))}")
end

#log_warn(message) ⇒ Object

Prints a warning message to STDOUT.

Parameters:

  • message (String)

    The message to print.



46
47
48
# File 'lib/ronin/core/cli/logging.rb', line 46

def log_warn(message)
  puts("#{colors.bold(colors.bright_red('/!\\'))} #{colors.bold(colors.bright_yellow(message))}")
end