style(rubocop): Style/GlobalStdStream

This commit is contained in:
Adam Cooke
2024-02-12 09:40:35 +00:00
parent 9563f30c96
commit 75be690748
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ Rails.application.configure do
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present? if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT) logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger) config.logger = ActiveSupport::TaggedLogging.new(logger)
end end
+1 -1
View File
@@ -96,7 +96,7 @@ module Postal
@loggers[name.to_sym] ||= begin @loggers[name.to_sym] ||= begin
require "postal/app_logger" require "postal/app_logger"
if config.logging.stdout || ENV["LOG_TO_STDOUT"] if config.logging.stdout || ENV["LOG_TO_STDOUT"]
Postal::AppLogger.new(name, STDOUT) Postal::AppLogger.new(name, $stdout)
else else
FileUtils.mkdir_p(log_root) FileUtils.mkdir_p(log_root)
Postal::AppLogger.new(name, log_root.join("#{name}.log"), config.logging.max_log_files, config.logging.max_log_file_size.megabytes) Postal::AppLogger.new(name, log_root.join("#{name}.log"), config.logging.max_log_files, config.logging.max_log_file_size.megabytes)
+1 -1
View File
@@ -341,7 +341,7 @@ module Postal
end end
def logger def logger
defined?(Rails) ? Rails.logger : Logger.new(STDOUT) defined?(Rails) ? Rails.logger : Logger.new($stdout)
end end
def slow_query_logger def slow_query_logger
+2 -2
View File
@@ -18,7 +18,7 @@ module Postal
BasicSocket.do_not_reverse_lookup = true BasicSocket.do_not_reverse_lookup = true
trap("USR1") do trap("USR1") do
STDOUT.puts "Received USR1 signal, respawning." $stdout.puts "Received USR1 signal, respawning."
fork do fork do
if ENV["APP_ROOT"] if ENV["APP_ROOT"]
Dir.chdir(ENV["APP_ROOT"]) Dir.chdir(ENV["APP_ROOT"])
@@ -29,7 +29,7 @@ module Postal
end end
trap("TERM") do trap("TERM") do
STDOUT.puts "Received TERM signal, shutting down." $stdout.puts "Received TERM signal, shutting down."
unlisten unlisten
end end
end end