grape-middleware-logger 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/CHANGELOG.md +32 -0
- data/CODE_OF_CONDUCT.md +30 -0
- data/README.md +2 -2
- data/grape-middleware-logger.gemspec +9 -1
- data/lib/grape/middleware/logger.rb +1 -1
- data/spec/integration/lib/grape/middleware/logger_spec.rb +16 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c09e5c24a2fe69018c3193eae50e2ce2f9879600
|
4
|
+
data.tar.gz: 6e728c86c74a64debb9071909edcb7dc93e72273
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9a08f38acf72a89882737bb91194a2b74c266d68c3b005bd24712aa42b0ade41c41cda9c88db027ca6653936a590e536b4f00bba7844d22fa61a1b5ac83836d
|
7
|
+
data.tar.gz: 2c0f0bb9dc3093a01adc33152de30235985541e6d59bfb32756b98286d922e204158500d4645546aebc279f463478e5244cc2b4dbef2b3e70f0e93c768a483b6
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
1.7.1 (11/1/2016)
|
2
|
+
==================
|
3
|
+
* Log the error class name (https://github.com/ridiculous/grape-middleware-logger/pull/13)
|
4
|
+
|
5
|
+
1.7.0 (8/2/2016)
|
6
|
+
==================
|
7
|
+
|
8
|
+
* Bump Grape dependency to 0.17
|
9
|
+
* Encourage `insert_after` when mounting to properly include query and post data
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
insert_after Grape::Middleware::Formatter, Grape::Middleware::Logger
|
13
|
+
```
|
14
|
+
|
15
|
+
1.6.0 (4/4/2016)
|
16
|
+
==================
|
17
|
+
|
18
|
+
* Can use default rake command to run test suite
|
19
|
+
* Fix [#4](https://github.com/ridiculous/grape-middleware-logger/issues/4), missing JSON parameters from POST requests
|
20
|
+
* Grape::Middleware::Formatter#before is Ruby 1.9.3 friendly
|
21
|
+
|
22
|
+
1.5.1 (12/15/2015)
|
23
|
+
==================
|
24
|
+
|
25
|
+
* Refactor logger conditional to use coercion and parallel assignment
|
26
|
+
|
27
|
+
|
28
|
+
1.5.0 (12/12/2015)
|
29
|
+
==================
|
30
|
+
|
31
|
+
* Use Railtie to setup default configuration for Rails apps
|
32
|
+
* Stop logging the namespace
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Grape::Middleware::logger Code of Conduct
|
2
|
+
|
3
|
+
The Grape::Middleware::logger project strongly values contributors from anywhere, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, ethnicity, age, religion, or nationality. As a result, the Grape::Middleware::logger team has agreed to and enforces this code of conduct in order to provide a harassment-free experience for everyone who participates in the development of Grape::Middleware::logger.
|
4
|
+
|
5
|
+
### Summary
|
6
|
+
|
7
|
+
Harassment in code and discussion or violation of physical boundaries is completely unacceptable anywhere in the Grape::Middleware::logger project’s codebases, issue trackers, chat rooms, mailing lists, meetups, and any other events. Violators will be warned and then blocked or banned by the core team at or before the 3rd violation.
|
8
|
+
|
9
|
+
### In detail
|
10
|
+
|
11
|
+
Harassment includes offensive verbal comments related to level of experience, gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, ethnicity, age, religion, nationality, the use of sexualized language or imagery, deliberate intimidation, stalking, sustained disruption, and unwelcome sexual attention.
|
12
|
+
|
13
|
+
Individuals asked to stop any harassing behavior are expected to comply immediately.
|
14
|
+
|
15
|
+
Maintainers, including the core team, are also subject to the anti-harassment policy.
|
16
|
+
|
17
|
+
If anyone engages in abusive, harassing, or otherwise unacceptable behavior, including maintainers, we may take appropriate action, up to and including warning the offender, deletion of comments, removal from the project’s codebase and communication systems, and escalation to Github support.
|
18
|
+
|
19
|
+
If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a member of the core team immediately.
|
20
|
+
|
21
|
+
We expect everyone to follow these rules anywhere in the logger project’s codebases, issue trackers, IRC channel, group chat, and mailing lists.
|
22
|
+
|
23
|
+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
24
|
+
|
25
|
+
Finally, don't forget that it is human to make mistakes! We all do. Let’s work together to help each other, resolve issues, and learn from the mistakes that we will all inevitably make from time to time.
|
26
|
+
|
27
|
+
|
28
|
+
### License
|
29
|
+
|
30
|
+
MIT
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# A logger for Grape apps
|
1
|
+
# A logger for [Grape](https://github.com/ruby-grape/grape) apps
|
2
2
|
[![Code Climate](https://codeclimate.com/github/ridiculous/grape-middleware-logger/badges/gpa.svg)](https://codeclimate.com/github/ridiculous/grape-middleware-logger) [![Gem Version](https://badge.fury.io/rb/grape-middleware-logger.svg)](http://badge.fury.io/rb/grape-middleware-logger)
|
3
3
|
[![Build Status](https://travis-ci.org/ridiculous/grape-middleware-logger.svg)](https://travis-ci.org/ridiculous/grape-middleware-logger)
|
4
4
|
|
@@ -23,7 +23,7 @@ gem 'grape-middleware-logger'
|
|
23
23
|
## Usage
|
24
24
|
```ruby
|
25
25
|
class API < Grape::API
|
26
|
-
# @note Make sure this is above
|
26
|
+
# @note Make sure this is above your first +mount+
|
27
27
|
insert_after Grape::Middleware::Formatter, Grape::Middleware::Logger
|
28
28
|
end
|
29
29
|
```
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'grape-middleware-logger'
|
5
|
-
spec.version = '1.7.
|
5
|
+
spec.version = '1.7.1'
|
6
6
|
spec.platform = Gem::Platform::RUBY
|
7
7
|
spec.authors = ['Ryan Buckley']
|
8
8
|
spec.email = ['arebuckley@gmail.com']
|
@@ -16,6 +16,14 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
|
19
|
+
spec.post_install_message = %q{
|
20
|
+
|
21
|
+
Grape::Middleware::Logger 1.7+ should be mounted with +insert_after+ to properly include POST params:
|
22
|
+
|
23
|
+
insert_after Grape::Middleware::Formatter, Grape::Middleware::Logger
|
24
|
+
|
25
|
+
}
|
26
|
+
|
19
27
|
spec.add_dependency 'grape', '>= 0.17', '< 1'
|
20
28
|
|
21
29
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
@@ -21,6 +21,22 @@ describe Grape::Middleware::Logger, type: :integration do
|
|
21
21
|
subject.call!(env)
|
22
22
|
end
|
23
23
|
|
24
|
+
context 'when an exception occurs' do
|
25
|
+
it 'logs all parts of the request including the error class' do
|
26
|
+
expect(subject.logger).to receive(:info).with ''
|
27
|
+
expect(subject.logger).to receive(:info).with %Q(Started POST "/api/1.0/users" at #{subject.start_time})
|
28
|
+
expect(subject.logger).to receive(:info).with %Q(Processing by TestAPI/users)
|
29
|
+
expect(subject.logger).to receive(:info).with %Q( Parameters: {"id"=>"101001", "secret"=>"[FILTERED]", "customer"=>[], "name"=>"foo", "password"=>"[FILTERED]"})
|
30
|
+
expect(subject.logger).to receive(:info).with %Q( ArgumentError: Whoops)
|
31
|
+
expect(subject.logger).to receive(:info).with /Completed 500 in \d+\.\d+ms/
|
32
|
+
expect(subject.logger).to receive(:info).with ''
|
33
|
+
expect(subject.app).to receive(:call).and_raise(ArgumentError, 'Whoops')
|
34
|
+
expect {
|
35
|
+
subject.call!(env)
|
36
|
+
}.to raise_error(ArgumentError)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
24
40
|
describe 'the "processing by" section' do
|
25
41
|
before { subject.call!(env) }
|
26
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-middleware-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|
@@ -101,6 +101,8 @@ extra_rdoc_files: []
|
|
101
101
|
files:
|
102
102
|
- ".gitignore"
|
103
103
|
- ".travis.yml"
|
104
|
+
- CHANGELOG.md
|
105
|
+
- CODE_OF_CONDUCT.md
|
104
106
|
- Gemfile
|
105
107
|
- LICENSE.txt
|
106
108
|
- README.md
|
@@ -119,7 +121,9 @@ homepage: https://github.com/ridiculous/grape-middleware-logger
|
|
119
121
|
licenses:
|
120
122
|
- MIT
|
121
123
|
metadata: {}
|
122
|
-
post_install_message:
|
124
|
+
post_install_message: "\n\nGrape::Middleware::Logger 1.7+ should be mounted with +insert_after+
|
125
|
+
to properly include POST params:\n\n insert_after Grape::Middleware::Formatter,
|
126
|
+
Grape::Middleware::Logger\n\n "
|
123
127
|
rdoc_options: []
|
124
128
|
require_paths:
|
125
129
|
- lib
|
@@ -147,4 +151,3 @@ test_files:
|
|
147
151
|
- spec/lib/grape/middleware/logger_spec.rb
|
148
152
|
- spec/rails_helper.rb
|
149
153
|
- spec/spec_helper.rb
|
150
|
-
has_rdoc:
|