lib/logster/configuration.rb in logster-0.8.3 vs lib/logster/configuration.rb in logster-0.8.4.pre
- old
+ new
@@ -1,5 +1,22 @@
module Logster
class Configuration
- attr_accessor :subdirectory, :current_context
+ attr_accessor :current_context, :allow_grouping, :environments
+ attr_writer :subdirectory
+
+ def initialize
+ # lambda |env,block|
+ @current_context = lambda{ |_, &block| block.call }
+ @environments = [:development, :production]
+ @subdirectory = nil
+
+ @allow_grouping = false
+ if defined?(::Rails) && Rails.env.production?
+ @allow_grouping = true
+ end
+ end
+
+ def subdirectory
+ @subdirectory || '/logs'
+ end
end
end