Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOMS-236 Use active support logger as base #170

Merged
merged 1 commit into from
Oct 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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