easy_log4r 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/easy_log4r/logger.rb +11 -12
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -31,21 +31,20 @@ class EasyLog4r::Logger
31
31
  def self.default_outputters
32
32
  return @outputters if @outputters
33
33
  @outputters = []
34
- formatter = default_formatter
34
+ @outputters << default_outputter('formatted_stdout', StdoutOutputter)
35
+ @outputters << default_outputter('formatter_stderr', StderrOutputter)
35
36
 
36
- if out = Log4r::Outputter['formatted_stdout']
37
- @outputters << out
38
- else
39
- @outputters << Log4r::StdoutOutputter.new('formatted_stdout', :formatter => formatter)
40
- end
37
+ return @outputters
38
+ end
41
39
 
42
- if out = Log4r::Outputter['formatted_stderr']
43
- @outputters << out
44
- else
45
- @outputters << Log4r::StderrOutputter.new('formatted_stderr', :formatter => formatter)
46
- end
40
+ ##
41
+ # Takes a name and Logger class and gives back a predefined logger, or a new instance of the given Log4r:: class
42
+ def self.default_outputter(name, clas)
43
+ clas = Log4r.instance_eval{ clas }
44
+ out = Log4r::Outputter[name]
45
+ out = clas.new(name, :formatter => default_formatter) unless out
47
46
 
48
- return @outputters
47
+ return out
49
48
  end
50
49
 
51
50
  ##
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_log4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-03 00:00:00.000000000 Z
12
+ date: 2012-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: log4r
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  segments:
148
148
  - 0
149
- hash: -2447249192999004886
149
+ hash: 2910441067260595711
150
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  none: false
152
152
  requirements: