From 64322963912f4b485980f4ba446f5bb1f5d43463 Mon Sep 17 00:00:00 2001 From: Malaber Date: Fri, 1 Jul 2022 22:21:23 +0200 Subject: [PATCH] Fix logging --- app/controllers/matches_controller.rb | 6 +++--- config/application.rb | 3 +++ config/environment.rb | 3 --- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index cf24488..2acf65f 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -53,8 +53,8 @@ class MatchesController < ApplicationController handle_match_end if new_state == 'finished' if @match.group_match? and new_state == "in_progress" group = @match.group - if UpdateGroupsGroupScoresAndSave.call(group: group).success? - Rails.logger.warn "Updating groups group score failed for #{group}" + unless UpdateGroupsGroupScoresAndSave.call(group: group).success? + logger.warn "Updating groups group score failed for #{group}" end end @@ -72,7 +72,7 @@ class MatchesController < ApplicationController if @match.group_match? group = @match.group 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 diff --git a/config/application.rb b/config/application.rb index ba2e151..7291b92 100644 --- a/config/application.rb +++ b/config/application.rb @@ -50,5 +50,8 @@ module TurniereBackend # Active Record config.active_record.legacy_connection_handling = false + + # Logging + config.logger = Logger.new(STDOUT) end end diff --git a/config/environment.rb b/config/environment.rb index d8d3793..d5abe55 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,6 +5,3 @@ require_relative 'application' # Initialize the Rails application. Rails.application.initialize! - -Rails.logger = Logger.new(STDOUT) -config.logger = ActiveSupport::Logger.new("log/#{Rails.env}.log")