require 'flydata-core/core_ext' require 'flydata-core/logger' module Flydata module CommandLoggable include_unless_included FlydataCore::Logger # hook 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 def log_info_stdout(message, log_params = {}) log_info(message, log_params, {stdout: true}) end def log_warn_stderr(message, log_params = {}) log_warn(message, log_params, {stderr: true}) end def log_error_stderr(message) log_error(message, log_params, {stderr: true}) end end end