class_logger 0.0.1 → 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -7
- data/lib/class_logger.rb +1 -3
- data/lib/class_logger/version.rb +1 -1
- metadata +1 -2
data/README.md
CHANGED
@@ -50,12 +50,6 @@ The following can be used in the *path* or *in* options.
|
|
50
50
|
<dt><strong>%<rails_root>s</strong></dt>
|
51
51
|
<dd>Will replace itself with Rails.root when in a rails app</dd>
|
52
52
|
|
53
|
-
<dt><strong>%<current>s</strong></dt>
|
54
|
-
<dd>Will replace itself with the +dirname+ of the file</dd>
|
55
|
-
|
56
|
-
<dt><strong>%<parent>s</strong></dt>
|
57
|
-
<dd>Will replace itself with the parent directory of the file</dd>
|
58
|
-
|
59
53
|
<dt><strong>%<class_name>s</strong></dt>
|
60
54
|
<dd>Will replace itself with the name of the class.</dd>
|
61
55
|
</dl>
|
@@ -118,7 +112,7 @@ Example Usage
|
|
118
112
|
# inside a class with a custom formatter
|
119
113
|
class Something
|
120
114
|
include ClassLogger
|
121
|
-
has_logger :path => "
|
115
|
+
has_logger :path => File.expand_path("../log", __FILE__), :rotate => :daily,
|
122
116
|
:formatter => proc{ |severity, time, program_name, message| "[%s](Something): %s\n" % [severity, message] }
|
123
117
|
|
124
118
|
def initialize
|
data/lib/class_logger.rb
CHANGED
@@ -30,9 +30,7 @@ module ClassLogger
|
|
30
30
|
def setup_logger(options)
|
31
31
|
interpolations = {
|
32
32
|
:rails_root => (defined?(Rails) ? Rails.root : ''),
|
33
|
-
:class_name => self.to_s.downcase
|
34
|
-
:current => File.dirname($FILENAME),
|
35
|
-
:parent => File.expand_path('../../', $FILENAME)
|
33
|
+
:class_name => self.to_s.downcase
|
36
34
|
}
|
37
35
|
|
38
36
|
file_path = File.join(options[:path], options[:in]).to_s % interpolations
|
data/lib/class_logger/version.rb
CHANGED