Module: Flydata::CommandLoggable

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 = {}, options = {}) ⇒ Object


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

def log_error_stderr(message, log_params = {}, options = {})
  log_error(message, log_params, {stderr: !options[:quiet]})
end

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


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

def log_info_stdout(message, log_params = {}, options = {})
  log_info(message, log_params, {stdout: !options[:quiet]})
end

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


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

def log_warn_stderr(message, log_params = {}, options = {})
  log_warn(message, log_params, {stderr: !options[:quiet]})
end