Skip to content

Commit

Permalink
Merge pull request #457 from shrimple-tech/feature/fix-log-subscriber…
Browse files Browse the repository at this point in the history
…-deprecation-warning

Fix compatibility issues with ActiveSupport::LogSubscriber#color
  • Loading branch information
jkeen authored Feb 27, 2024
2 parents 14e84ef + 6212335 commit 88ca46d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/graphiti.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ def self.logger=(val)
end

def self.log(msg, color = :white, bold = false)
colored = ActiveSupport::LogSubscriber.new.send(:color, msg, color, bold)
if ::ActiveSupport.version >= Gem::Version.new("7.1")
colored = ActiveSupport::LogSubscriber.new.send(:color, msg, color, bold: bold)
else
colored = ActiveSupport::LogSubscriber.new.send(:color, msg, color, bold)
end

logger.debug(colored)
end

Expand Down

0 comments on commit 88ca46d

Please sign in to comment.