Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Commit

Permalink
Merge 304d2e3 into 713b3a4
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyHKafoury committed Oct 15, 2019
2 parents 713b3a4 + 304d2e3 commit 07ec207
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 113 deletions.
32 changes: 0 additions & 32 deletions .rubocop.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .rubocop_todo.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.4
2.6.5
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
sudo: false
language: ruby
rvm:
- 2.6.4
cache:
bundler: true
services:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "2.6.4"
ruby "2.6.5"

gem "rails", "~> 5.2.3"
gem "active_model_serializers"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ DEPENDENCIES
xml-simple

RUBY VERSION
ruby 2.6.4p104
ruby 2.6.5p114

BUNDLED WITH
1.17.3
6 changes: 5 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
module CasAuthenticatedApi
class Application < Rails::Application
# Enable ougai
config.logger = Log::Logger.new(Rails.root.join("log", "datadog.log"))
if Rails.env.development? || Rails.const_defined?("Console")
config.logger = Log::Logger.new(STDOUT)
elsif !Rails.env.test? # use default logger in test env
config.logger = Log::Logger.new(Rails.root.join("log", "datadog.log"))
end
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2

Expand Down
3 changes: 2 additions & 1 deletion lib/log/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ class Logger < Ougai::Logger
include LoggerSilence

def initialize(*args)
@readable = args[0] == STDOUT
super
after_initialize if respond_to? :after_initialize
end

def create_formatter
if Rails.env.development? || Rails.env.test?
if @readable
Log::Logger::FormatterReadable.new(STDOUT)
else
Log::Logger::Formatter.new(ENV["PROJECT_NAME"])
Expand Down

0 comments on commit 07ec207

Please sign in to comment.