lib/eco/api/session.rb in eco-helpers-3.0.4 vs lib/eco/api/session.rb in eco-helpers-3.0.5

- old
+ new

@@ -20,11 +20,13 @@ super(env) @entry_factories = {} @person_factories = {} - logger.debug("LINE COMMAND: #{$0} #{ARGV.join(" ")}") # rubocop:disable Style/SpecialGlobalVars + log(:debug) { + "LINE COMMAND: #{$0} #{ARGV.join(" ")}" # rubocop:disable Style/SpecialGlobalVars + } end # @retrun [String] the name of the current environment def enviro_name config.active_enviro @@ -325,11 +327,13 @@ # @param (see Eco::API::Common::Session::Mailer#mail) def mail(**kargs) if mailer? mailer.mail(**kargs) else - logger.error("You are trying to use the mailer, but it's not configured") + log(:error) { + "You are trying to use the mailer, but it's not configured" + } nil end end # Uploads content into a file, a file or a directory to S3 @@ -351,15 +355,20 @@ elsif file path = s3uploader.upload_file(file) elsif directory path = s3uploader.upload_directory(directory, recurse: recurse) else - logger.error("To use Session.s3upload, you must specify either directory, file or content and file name") + log(:error) { + "To use Session.s3upload, you must specify either directory, file or content and file name" + } end return path unless link + s3uploader.link(path) else - logger.error("You are trying to use S3 uploader, but it's not configured") + log(:error) { + "You are trying to use S3 uploader, but it's not configured" + } nil end end # @!endgroup