Module: Patcmd::CLI::Helpers::Logger

Included in:
BaseCommand
Defined in:
lib/patcmd/cli/helpers/logger.rb

Instance Method Summary collapse

Instance Method Details

#log_error(message) ⇒ void

This method returns an undefined value.

Logs an error message with a timestamp.

Parameters:

  • message (String)

    The message to log.



19
20
21
# File 'lib/patcmd/cli/helpers/logger.rb', line 19

def log_error(message)
  puts "[ERROR] #{Time.now.strftime("%Y-%m-%d %H:%M:%S")} - #{message}"
end

#log_info(message) ⇒ void

This method returns an undefined value.

Logs an informational message with a timestamp.

Parameters:

  • message (String)

    The message to log.



11
12
13
# File 'lib/patcmd/cli/helpers/logger.rb', line 11

def log_info(message)
  puts "[INFO] #{Time.now.strftime("%Y-%m-%d %H:%M:%S")} - #{message}"
end