Module: Flydata::CommandLoggable

Included in:
Cli, Flydata::Command::Base, CompatibilityCheck, Output::ForwarderFactory, Output::TcpForwarder
Defined in:
lib/flydata/command_loggable.rb

Instance Method Summary collapse

Instance Method Details

#before_logging(level, raw_msg, built_msg, log_params, options) ⇒ Object

hook


9
10
11
12
# File 'lib/flydata/command_loggable.rb', line 9

def before_logging(level, raw_msg, built_msg, log_params, options)
  $stdout.puts raw_msg if options[:stdout]
  $stderr.puts raw_msg if options[:stderr]
end

#log_error_stderr(message, log_params = {}) ⇒ Object


22
23
24
# File 'lib/flydata/command_loggable.rb', line 22

def log_error_stderr(message, log_params = {})
  log_error(message, log_params, {stderr: true})
end

#log_info_stdout(message, log_params = {}) ⇒ Object


14
15
16
# File 'lib/flydata/command_loggable.rb', line 14

def log_info_stdout(message, log_params = {})
  log_info(message, log_params, {stdout: true})
end

#log_warn_stderr(message, log_params = {}) ⇒ Object


18
19
20
# File 'lib/flydata/command_loggable.rb', line 18

def log_warn_stderr(message, log_params = {})
  log_warn(message, log_params, {stderr: true})
end