Fix logging

This commit is contained in:
Daniel Schädler 2022-07-01 22:21:23 +02:00
parent b609549659
commit 6432296391
Signed by: Malaber
GPG Key ID: 4BB175A9617E4B11
3 changed files with 6 additions and 6 deletions

View File

@ -53,8 +53,8 @@ class MatchesController < ApplicationController
handle_match_end if new_state == 'finished' handle_match_end if new_state == 'finished'
if @match.group_match? and new_state == "in_progress" if @match.group_match? and new_state == "in_progress"
group = @match.group group = @match.group
if UpdateGroupsGroupScoresAndSave.call(group: group).success? unless UpdateGroupsGroupScoresAndSave.call(group: group).success?
Rails.logger.warn "Updating groups group score failed for #{group}" logger.warn "Updating groups group score failed for #{group}"
end end
end end
@ -72,7 +72,7 @@ class MatchesController < ApplicationController
if @match.group_match? if @match.group_match?
group = @match.group group = @match.group
unless UpdateGroupsGroupScoresAndSave.call(group: group).success? unless UpdateGroupsGroupScoresAndSave.call(group: group).success?
Rails.logger.warn "Updating groups group score failed for #{group}" logger.warn "Updating groups group score failed for #{group}"
end end
end end

View File

@ -50,5 +50,8 @@ module TurniereBackend
# Active Record # Active Record
config.active_record.legacy_connection_handling = false config.active_record.legacy_connection_handling = false
# Logging
config.logger = Logger.new(STDOUT)
end end
end end

View File

@ -5,6 +5,3 @@ require_relative 'application'
# Initialize the Rails application. # Initialize the Rails application.
Rails.application.initialize! Rails.application.initialize!
Rails.logger = Logger.new(STDOUT)
config.logger = ActiveSupport::Logger.new("log/#{Rails.env}.log")