loggr 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,9 @@
1
1
  require 'loggr/adapter/abstract'
2
+ require 'loggr/support/annotations'
2
3
 
3
4
  module Loggr
4
5
  module Adapter
5
-
6
+
6
7
  # Always uses the logger defined on `Rails.logger`, CAVEAT ensure to never
7
8
  # ever set `Rails.logger` to this backend, i.e.:
8
9
  #
@@ -21,15 +22,16 @@ module Loggr
21
22
  # config.logger = Loggr.logger('rails', :backend => Loggr::Adapter::Buffered)
22
23
  #
23
24
  class RailsAdapter < AbstractAdapter
24
-
25
+
25
26
  # The rails backend ignores all options as it just returns
26
27
  # always returns `Rails.logger` :)
27
28
  #
29
+ # Ensures we get some black magic using `tagged` and `mapped`.
28
30
  def logger(name, options = {})
29
- ::Rails.logger
31
+ Loggr::Support::Annotations.enhance ::Rails.logger
30
32
  end
31
33
  end
32
-
34
+
33
35
  # THE Rails backed implementation instance
34
36
  Rails = RailsAdapter.new
35
37
  end
@@ -17,6 +17,7 @@ module Loggr
17
17
  # to handle both `tagged` and `mapped` on the logger itself.
18
18
  #
19
19
  def self.enhance(logger)
20
+ return logger if logger.respond_to?(:tagged) && logger.respond_to?(:mapped)
20
21
  return ::ActiveSupport::TaggedLogging.new(logger) if defined?(::ActiveSupport::TaggedLogging)
21
22
  logger.send(:extend, NOPSupport)
22
23
  end
data/lib/loggr/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Loggr
2
2
  # Called gem version for compatibility with loggr/agents/loggr-rb (loggr-rb gem)
3
- GEM_VERSION = "1.1.0"
3
+ GEM_VERSION = "1.1.1"
4
4
  end
@@ -18,12 +18,15 @@ class Loggr::Adapter::RailsTest < MiniTest::Unit::TestCase
18
18
  @adapter = Loggr::Adapter::RailsAdapter.new
19
19
  end
20
20
 
21
+ include Loggr::Lint::Tests
22
+
21
23
  def test_rails_should_be_a_rails_adapter
22
24
  assert_kind_of Loggr::Adapter::RailsAdapter, Loggr::Adapter::Rails
23
25
  end
24
26
 
25
27
  def test_should_use_same_logger_as_rails
26
- assert_equal ::Rails.logger, Loggr::Adapter::Rails.logger('log')
28
+ @logger = Loggr::Adapter::Rails.logger('log')
29
+ assert_equal ::Rails.logger, as_3_2? ? @logger.instance_variable_get('@logger') : @logger
27
30
  end
28
31
 
29
32
  def test_should_default_to_rails_adapter
metadata CHANGED
@@ -1,65 +1,89 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loggr
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 17
4
5
  prerelease:
5
- version: 1.1.0
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 1
10
+ version: 1.1.1
6
11
  platform: ruby
7
12
  authors:
8
- - Lukas Westermann
13
+ - Lukas Westermann
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-11-30 00:00:00 +01:00
14
- default_executable:
18
+ date: 2011-11-30 00:00:00 Z
15
19
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: rake
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: 0.8.7
25
- type: :development
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: minitest
29
- prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
31
- none: false
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: 2.3.0
36
- type: :development
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: activesupport
40
- prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 3.0.0
47
- type: :development
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: appraisal
51
- prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 0.3.8
58
- type: :development
59
- version_requirements: *id004
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 49
29
+ segments:
30
+ - 0
31
+ - 8
32
+ - 7
33
+ version: 0.8.7
34
+ type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: minitest
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 2
47
+ - 3
48
+ - 0
49
+ version: 2.3.0
50
+ type: :development
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: activesupport
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 7
61
+ segments:
62
+ - 3
63
+ - 0
64
+ - 0
65
+ version: 3.0.0
66
+ type: :development
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
69
+ name: appraisal
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 3
77
+ segments:
78
+ - 0
79
+ - 3
80
+ - 8
81
+ version: 0.3.8
82
+ type: :development
83
+ version_requirements: *id004
60
84
  description: Adapters for different ruby logging backends. Create loggers using different adapters, like Logger (Stdlib), Rails or SLF4J (in JRuby only).
61
85
  email:
62
- - lukas@at-point.ch
86
+ - lukas@at-point.ch
63
87
  executables: []
64
88
 
65
89
  extensions: []
@@ -67,51 +91,50 @@ extensions: []
67
91
  extra_rdoc_files: []
68
92
 
69
93
  files:
70
- - .gitignore
71
- - .travis.yml
72
- - Appraisals
73
- - Gemfile
74
- - LICENSES.md
75
- - MIT-LICENSE
76
- - README.md
77
- - Rakefile
78
- - gemfiles/activesupport-3.0.x.gemfile
79
- - gemfiles/activesupport-3.1.gemfile
80
- - gemfiles/activesupport-head.gemfile
81
- - lib/logback-classic-0.9.29.jar
82
- - lib/logback-core-0.9.29.jar
83
- - lib/loggr.rb
84
- - lib/loggr/adapter.rb
85
- - lib/loggr/adapter/abstract.rb
86
- - lib/loggr/adapter/base.rb
87
- - lib/loggr/adapter/buffered.rb
88
- - lib/loggr/adapter/nop.rb
89
- - lib/loggr/adapter/rails.rb
90
- - lib/loggr/adapter/slf4j.rb
91
- - lib/loggr/factory.rb
92
- - lib/loggr/lint.rb
93
- - lib/loggr/severity.rb
94
- - lib/loggr/slf4j.rb
95
- - lib/loggr/slf4j/jars.rb
96
- - lib/loggr/slf4j/logger.rb
97
- - lib/loggr/slf4j/mdc.rb
98
- - lib/loggr/support/annotations.rb
99
- - lib/loggr/version.rb
100
- - lib/slf4j-api-1.6.1.jar
101
- - loggr.gemspec
102
- - test/logback_helper.rb
103
- - test/test_helper.rb
104
- - test/unit/adapter/abstract_test.rb
105
- - test/unit/adapter/base_test.rb
106
- - test/unit/adapter/buffered_test.rb
107
- - test/unit/adapter/nop_test.rb
108
- - test/unit/adapter/rails_test.rb
109
- - test/unit/adapter/slf4j_test.rb
110
- - test/unit/factory_test.rb
111
- - test/unit/slf4j/jars_test.rb
112
- - test/unit/slf4j/logger_test.rb
113
- - test/unit/slf4j/mdc_test.rb
114
- has_rdoc: true
94
+ - .gitignore
95
+ - .travis.yml
96
+ - Appraisals
97
+ - Gemfile
98
+ - LICENSES.md
99
+ - MIT-LICENSE
100
+ - README.md
101
+ - Rakefile
102
+ - gemfiles/activesupport-3.0.x.gemfile
103
+ - gemfiles/activesupport-3.1.gemfile
104
+ - gemfiles/activesupport-head.gemfile
105
+ - lib/logback-classic-0.9.29.jar
106
+ - lib/logback-core-0.9.29.jar
107
+ - lib/loggr.rb
108
+ - lib/loggr/adapter.rb
109
+ - lib/loggr/adapter/abstract.rb
110
+ - lib/loggr/adapter/base.rb
111
+ - lib/loggr/adapter/buffered.rb
112
+ - lib/loggr/adapter/nop.rb
113
+ - lib/loggr/adapter/rails.rb
114
+ - lib/loggr/adapter/slf4j.rb
115
+ - lib/loggr/factory.rb
116
+ - lib/loggr/lint.rb
117
+ - lib/loggr/severity.rb
118
+ - lib/loggr/slf4j.rb
119
+ - lib/loggr/slf4j/jars.rb
120
+ - lib/loggr/slf4j/logger.rb
121
+ - lib/loggr/slf4j/mdc.rb
122
+ - lib/loggr/support/annotations.rb
123
+ - lib/loggr/version.rb
124
+ - lib/slf4j-api-1.6.1.jar
125
+ - loggr.gemspec
126
+ - test/logback_helper.rb
127
+ - test/test_helper.rb
128
+ - test/unit/adapter/abstract_test.rb
129
+ - test/unit/adapter/base_test.rb
130
+ - test/unit/adapter/buffered_test.rb
131
+ - test/unit/adapter/nop_test.rb
132
+ - test/unit/adapter/rails_test.rb
133
+ - test/unit/adapter/slf4j_test.rb
134
+ - test/unit/factory_test.rb
135
+ - test/unit/slf4j/jars_test.rb
136
+ - test/unit/slf4j/logger_test.rb
137
+ - test/unit/slf4j/mdc_test.rb
115
138
  homepage: https://github.com/at-point/loggr/wiki
116
139
  licenses: []
117
140
 
@@ -119,36 +142,46 @@ post_install_message:
119
142
  rdoc_options: []
120
143
 
121
144
  require_paths:
122
- - lib
145
+ - lib
123
146
  required_ruby_version: !ruby/object:Gem::Requirement
124
147
  none: false
125
148
  requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: 1.8.7
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ hash: 57
152
+ segments:
153
+ - 1
154
+ - 8
155
+ - 7
156
+ version: 1.8.7
129
157
  required_rubygems_version: !ruby/object:Gem::Requirement
130
158
  none: false
131
159
  requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 1.3.6
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ hash: 23
163
+ segments:
164
+ - 1
165
+ - 3
166
+ - 6
167
+ version: 1.3.6
135
168
  requirements: []
136
169
 
137
170
  rubyforge_project:
138
- rubygems_version: 1.5.1
171
+ rubygems_version: 1.8.10
139
172
  signing_key:
140
173
  specification_version: 3
141
174
  summary: Logger factory framework (including an SLF4J wrapper)
142
175
  test_files:
143
- - test/logback_helper.rb
144
- - test/test_helper.rb
145
- - test/unit/adapter/abstract_test.rb
146
- - test/unit/adapter/base_test.rb
147
- - test/unit/adapter/buffered_test.rb
148
- - test/unit/adapter/nop_test.rb
149
- - test/unit/adapter/rails_test.rb
150
- - test/unit/adapter/slf4j_test.rb
151
- - test/unit/factory_test.rb
152
- - test/unit/slf4j/jars_test.rb
153
- - test/unit/slf4j/logger_test.rb
154
- - test/unit/slf4j/mdc_test.rb
176
+ - test/logback_helper.rb
177
+ - test/test_helper.rb
178
+ - test/unit/adapter/abstract_test.rb
179
+ - test/unit/adapter/base_test.rb
180
+ - test/unit/adapter/buffered_test.rb
181
+ - test/unit/adapter/nop_test.rb
182
+ - test/unit/adapter/rails_test.rb
183
+ - test/unit/adapter/slf4j_test.rb
184
+ - test/unit/factory_test.rb
185
+ - test/unit/slf4j/jars_test.rb
186
+ - test/unit/slf4j/logger_test.rb
187
+ - test/unit/slf4j/mdc_test.rb