lib/octopus/logger.rb in ar-octopus-0.4.0 vs lib/octopus/logger.rb in ar-octopus-0.5.0
- old
+ new
@@ -1,14 +1,19 @@
require "logger"
class Octopus::Logger < Logger
+ def initialize(logdev, shift_age = 0, shift_size = 1048576)
+ ActiveSupport::Deprecation.warn "Octopus::Logger is deprecated and will be removed in Octopus 0.6.x", caller
+ super
+ end
+
def format_message(severity, timestamp, progname, msg)
- str = super
-
+ str = super
+
if ActiveRecord::Base.connection.respond_to?(:current_shard)
- str += "Shard: #{ActiveRecord::Base.connection.current_shard} -"
+ str += "Shard: #{ActiveRecord::Base.connection.current_shard} -"
end
-
+
str
end
end