lograge-tagged 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NzIxMzY0MWE4ZjBjOTJhOWE0YmJmODUwZTcxMDI2M2E3MzFkNWRiNw==
5
- data.tar.gz: !binary |-
6
- M2ZjNjU5NWRkMDVjYWMyMmJhOTQ3YTk4ZTkyNDJjYWQyMDBhOTE1NQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZTQzMmJhOWQwMDg5YTRiMmRjMzc4ZTZmNmFhYmRkOThhMTNiZGI3ZDYxNGNj
10
- ZjQ5Mzk3ZjUyMWQyZjUyZDE1ZTQwYjQwZDQ1MDkxZDYxNTJjZTE4MmZlY2Ji
11
- NjNkN2NjZTIzMGViOWY3NWUzYzdmMDNmZGYxNzMxOWM3Y2E1Nzc=
12
- data.tar.gz: !binary |-
13
- Y2NmNmIzMzQ0ZmIwMDlkY2VjYjhmMWIxMzhkMTU1MTBhNzg3NTQwOTMyY2U4
14
- OTBkNWFjYWZiZDVkNTAzMTllYWEzYWM5MTFjNDdiNzQwOTAzZDk3MjJmOTBm
15
- MWZmY2E2ZGJiNWVhZTNjNGQ4N2YyNTU3OTg5NDI5OGU5OGE5MmU=
2
+ SHA1:
3
+ metadata.gz: 3cbc57fc17a945ccc151f30b590bbd453fa6b7b5
4
+ data.tar.gz: fb9809f1441f5dc137e10321e3700ea41214f88e
5
+ SHA512:
6
+ metadata.gz: d6c528362b5ef512672278f46d132320bb74d3104ea4b70d4a332354a2d32327d6e486c5d2c1388e21ac483835bd212023258c34ce1d922b34ffef22030635d7
7
+ data.tar.gz: 394af3a3e561437d9136605fbc0cd8d08a814173c882ca7ad8154de4cbe7e0c31c0532f57b4bc8c73ca7218f3ed4b117baa9979ba8eb97dced018c1583e4557f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## Release 0.2.0
4
+
5
+ - FIXED: Compatibility with the new syntax in Lograge > 0.2.1
6
+
3
7
  ## Release 0.1.1
4
8
 
5
9
  - FIXED: Custom settings were not applied.
@@ -1,3 +1,3 @@
1
1
  module LogrageTagged
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -2,25 +2,16 @@ require 'lograge'
2
2
  require 'lograge_tagged/version'
3
3
 
4
4
  module LogrageTagged
5
- module LogSubscriber
6
- # A custom formatter for Lograge logs.
7
- #
8
- # This formatter delegates the log generation to +process_action_lograge+,
9
- # but it also appends a custom prefix for lookup.
10
- def process_action_tagged(*args)
11
- output = process_action_lograge(*args)
12
- "[request.app] #{output}"
5
+ class TaggedKeyValueFormatter < Lograge::Formatters::KeyValue
6
+ def call(data)
7
+ "[request.app] #{super}"
13
8
  end
14
9
  end
15
10
 
16
11
  class Railtie < Rails::Railtie
17
- initializer "lograge-tagged", :before => :lograge do |app|
18
- app.config.lograge.log_format = :tagged
19
- app.config.lograge.custom_options = ->(event) {
20
- { params: event.payload[:params] }
21
- }
12
+ initializer "lograge-tagged", before: :lograge do |app|
13
+ app.config.lograge.formatter = LogrageTagged::TaggedKeyValueFormatter.new
14
+ app.config.lograge.custom_options = ->(event) { { params: event.payload[:params] } }
22
15
  end
23
16
  end if defined?(Rails)
24
17
  end
25
-
26
- Lograge::RequestLogSubscriber.send(:include, LogrageTagged::LogSubscriber)
@@ -17,6 +17,6 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_runtime_dependency "lograge", "~> 0.2"
20
+ gem.add_runtime_dependency "lograge", "~> 0.2.2"
21
21
  gem.add_development_dependency "rspec"
22
22
  end
@@ -1,22 +1,8 @@
1
1
  require 'spec_helper'
2
2
  require 'lograge_tagged'
3
3
 
4
- describe LogrageTagged::LogSubscriber do
5
-
6
- subject { LogrageLogSubscriber.new }
7
-
8
- LogrageLogSubscriber = Class.new do
9
- include LogrageTagged::LogSubscriber
10
- def process_action_lograge(payload)
11
- payload.map { |k,v| "#{k}=#{v}" }.join(" ")
12
- end
13
- end
14
-
15
- describe "#process_action_tagged" do
16
- it "prepends the tag to the processed payload" do
17
- line = subject.process_action_tagged(foo: "1", bar: "2")
18
- line.should eq("[request.app] foo=1 bar=2")
19
- end
4
+ describe LogrageTagged do
5
+ it "has empty specs for now" do
6
+ expect("".empty?).to be_true
20
7
  end
21
-
22
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lograge-tagged
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-10 00:00:00.000000000 Z
11
+ date: 2013-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lograge
@@ -16,26 +16,26 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: 0.2.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: 0.2.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: A tagged LogSubscriber for Lograge.
@@ -48,7 +48,6 @@ files:
48
48
  - .gitignore
49
49
  - .rspec
50
50
  - .ruby-gemset
51
- - .ruby-version
52
51
  - .travis.yml
53
52
  - CHANGELOG.md
54
53
  - Gemfile
@@ -70,17 +69,17 @@ require_paths:
70
69
  - lib
71
70
  required_ruby_version: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - ! '>='
72
+ - - '>='
74
73
  - !ruby/object:Gem::Version
75
74
  version: '0'
76
75
  required_rubygems_version: !ruby/object:Gem::Requirement
77
76
  requirements:
78
- - - ! '>='
77
+ - - '>='
79
78
  - !ruby/object:Gem::Version
80
79
  version: '0'
81
80
  requirements: []
82
81
  rubyforge_project:
83
- rubygems_version: 2.0.3
82
+ rubygems_version: 2.1.10
84
83
  signing_key:
85
84
  specification_version: 4
86
85
  summary: A tagged LogSubscriber for Lograge
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- ruby-1.9.3-p392