Permalink
Browse files

removed interpolations that seemed to hurt rails

  • Loading branch information...
1 parent 36b9c5e commit e491d4161562ac634387bccfe055abfae6be5afc @robhurring committed Jan 27, 2011
Showing with 3 additions and 11 deletions.
  1. +1 −7 README.md
  2. +1 −3 lib/class_logger.rb
  3. +1 −1 lib/class_logger/version.rb
View
@@ -50,12 +50,6 @@ The following can be used in the *path* or *in* options.
<dt><strong>%&lt;rails_root>s</strong></dt>
<dd>Will replace itself with Rails.root when in a rails app</dd>
- <dt><strong>%&lt;current>s</strong></dt>
- <dd>Will replace itself with the +dirname+ of the file</dd>
-
- <dt><strong>%&lt;parent>s</strong></dt>
- <dd>Will replace itself with the parent directory of the file</dd>
-
<dt><strong>%&lt;class_name>s</strong></dt>
<dd>Will replace itself with the name of the class.</dd>
</dl>
@@ -118,7 +112,7 @@ Example Usage
# inside a class with a custom formatter
class Something
include ClassLogger
- has_logger :path => "%&lt;current>s/log", :rotate => :daily,
+ has_logger :path => File.expand_path("../log", __FILE__), :rotate => :daily,
:formatter => proc{ |severity, time, program_name, message| "[%s](Something): %s\n" % [severity, message] }
def initialize
View
@@ -30,9 +30,7 @@ def loggers
def setup_logger(options)
interpolations = {
:rails_root => (defined?(Rails) ? Rails.root : ''),
- :class_name => self.to_s.downcase,
- :current => File.dirname($FILENAME),
- :parent => File.expand_path('../../', $FILENAME)
+ :class_name => self.to_s.downcase
}
file_path = File.join(options[:path], options[:in]).to_s % interpolations
@@ -1,3 +1,3 @@
module ClassLogger
- VERSION = "0.0.1"
+ VERSION = "0.1"
end

0 comments on commit e491d41

Please sign in to comment.