Skip to content

Commit

Permalink
HOMS-236 Use active support logger as base
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Vershinin authored and hydra-billing-robot committed Oct 12, 2018
1 parent 77f4c6a commit 948b695
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

require 'homs_logger'

config.logger = HomsLogger.new(Logger.new(STDOUT))
config.logger = HomsLogger.new(ActiveSupport::Logger.new(STDOUT))

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# Use a different logger for distributed setups.
require 'homs_logger'

config.logger = HomsLogger.new(Logger.new(STDOUT))
config.logger = HomsLogger.new(ActiveSupport::Logger.new(STDOUT))

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
Expand Down
6 changes: 3 additions & 3 deletions hbw/lib/hbw/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module HBWLogger

def self.new(logger)
if Rails.env.production?
logger.formatter ||= HBWFormatterProduction.new
logger.formatter = HBWFormatterProduction.new
else
logger.formatter ||= HBWFormatter.new
logger.formatter = HBWFormatter.new
end

logger.extend(self)
Expand All @@ -33,7 +33,7 @@ def self.new(logger)
module HBW
module Logger
def logger
HBWLogger.new(::Logger.new(STDOUT))
HBWLogger.new(ActiveSupport::Logger.new(STDOUT))
end
end
end
4 changes: 2 additions & 2 deletions lib/homs_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module HomsLogger

def self.new(logger)
if Rails.env.production?
logger.formatter ||= HomsFormatterProduction.new
logger.formatter = HomsFormatterProduction.new
else
logger.formatter ||= HomsFormatter.new
logger.formatter = HomsFormatter.new
end

logger.extend(self)
Expand Down

0 comments on commit 948b695

Please sign in to comment.