logging_good 1.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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +18 -1
- data/Logging-Good.gif +0 -0
- data/README.md +46 -22
- data/lib/logging_good.rb +2 -1
- data/lib/logging_good/version.rb +1 -1
- data/logging_good.gemspec +2 -0
- metadata +37 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49ab600ebb43eaa6f928434f76b43775455194708154390297200361bd8a73ba
|
4
|
+
data.tar.gz: a512714a6d1ee8481e1e42ce2776024dc4d3d05f6dd7d46e67565b0d067acabf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bbd9eeae217c1b05692a3954cac58cfc6754c6540d9119dc5f64b9d542f932bf95ade204d0820973e8d6495f8c5c5a7863b6fe4dd9d04f78898629d892f3691
|
7
|
+
data.tar.gz: 2d0bbfe41afca1ad6116d5b9de1194ff6d7d608b444b192abe9eda2abe10ec28ad4596e9ca285d24b6459807c6ac8f5e4ad6da44a7a0e1f1e029b8b0bd71f686
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
logging_good (
|
4
|
+
logging_good (1.0.0)
|
5
5
|
terminal-table (~> 1.8)
|
6
6
|
unicode-display_width (~> 1.6)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
+
codecov (0.1.14)
|
12
|
+
json
|
13
|
+
simplecov
|
14
|
+
url
|
11
15
|
diff-lcs (1.3)
|
16
|
+
docile (1.3.2)
|
17
|
+
figaro (1.1.1)
|
18
|
+
thor (~> 0.14)
|
19
|
+
json (2.2.0)
|
12
20
|
rake (10.5.0)
|
13
21
|
rspec (3.8.0)
|
14
22
|
rspec-core (~> 3.8.0)
|
@@ -23,15 +31,24 @@ GEM
|
|
23
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
24
32
|
rspec-support (~> 3.8.0)
|
25
33
|
rspec-support (3.8.2)
|
34
|
+
simplecov (0.17.0)
|
35
|
+
docile (~> 1.1)
|
36
|
+
json (>= 1.8, < 3)
|
37
|
+
simplecov-html (~> 0.10.0)
|
38
|
+
simplecov-html (0.10.2)
|
26
39
|
terminal-table (1.8.0)
|
27
40
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
41
|
+
thor (0.20.3)
|
28
42
|
unicode-display_width (1.6.0)
|
43
|
+
url (0.3.2)
|
29
44
|
|
30
45
|
PLATFORMS
|
31
46
|
ruby
|
32
47
|
|
33
48
|
DEPENDENCIES
|
34
49
|
bundler (~> 2.0)
|
50
|
+
codecov
|
51
|
+
figaro (~> 1.1, >= 1.1.1)
|
35
52
|
logging_good!
|
36
53
|
rake (~> 10.0)
|
37
54
|
rspec (~> 3.0)
|
data/Logging-Good.gif
ADDED
Binary file
|
data/README.md
CHANGED
@@ -1,12 +1,18 @@
|
|
1
|
-
#
|
1
|
+
# Logging-Good
|
2
2
|
|
3
|
-
|
3
|
+
### hereafter, Rails logger is your best friend 👬
|
4
4
|
|
5
|
-
|
5
|
+
[](http://rubygems.org/gems/logging_good "View this project in Rubygems")
|
6
|
+
[](https://travis-ci.org/manojnaidu619/logging-good)
|
7
|
+
[](https://codecov.io/gh/manojnaidu619/logging-good)
|
8
|
+
[](https://codebeat.co/projects/github-com-manojnaidu619-logging-good-master)
|
6
9
|
|
7
|
-
|
10
|
+
[](https://github.com/manojnaidu619/logging-good/pulls)
|
11
|
+
[](https://saythanks.io/to/manojnaidu619)
|
12
|
+
|
13
|
+

|
8
14
|
|
9
|
-
|
15
|
+
## Installation
|
10
16
|
|
11
17
|
```ruby
|
12
18
|
gem 'logging_good'
|
@@ -20,24 +26,42 @@ Or install it yourself as:
|
|
20
26
|
|
21
27
|
$ gem install logging_good
|
22
28
|
|
23
|
-
##
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/logging_good. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
29
|
+
## How to use
|
36
30
|
|
37
|
-
|
31
|
+
**IMPORTANT** ! This gem is dependent on two other display formatting gems. Install it by adding below lines to your `Gemfile`
|
38
32
|
|
39
|
-
|
33
|
+
```ruby
|
34
|
+
gem "unicode-display_width", '~> 1.6'
|
35
|
+
gem "terminal-table", '~> 1.8', '>= 1.8.0'
|
36
|
+
```
|
37
|
+
then run `$ bundle install`
|
40
38
|
|
41
|
-
|
39
|
+
So. After installing the above mentioned gems into your `Gemfile`, you are all set to explore this gem further...
|
42
40
|
|
43
|
-
|
41
|
+
Now, add this line into your controller action(s) to get started!
|
42
|
+
```ruby
|
43
|
+
Now.logging_good(params)
|
44
|
+
```
|
45
|
+
Other optional Arguments :
|
46
|
+
```ruby
|
47
|
+
request
|
48
|
+
response.headers
|
49
|
+
```
|
50
|
+
example:
|
51
|
+
```ruby
|
52
|
+
# In app/controllers/abcd_controller.rb
|
53
|
+
|
54
|
+
def index
|
55
|
+
Now.logging_good(params, request)
|
56
|
+
......
|
57
|
+
......
|
58
|
+
end
|
59
|
+
|
60
|
+
def create
|
61
|
+
Now.logging_good(params)
|
62
|
+
......
|
63
|
+
......
|
64
|
+
end
|
65
|
+
......
|
66
|
+
```
|
67
|
+
That's Basically it. You are now able to see beautifully formatted data in your rails logs 🙌
|
data/lib/logging_good.rb
CHANGED
@@ -50,7 +50,8 @@ def request_table(request)
|
|
50
50
|
HTTP_ACCEPT: req["HTTP_ACCEPT"],
|
51
51
|
HTTP_CONNECTION: req["HTTP_CONNECTION"],
|
52
52
|
SERVER_NAME: req["SERVER_NAME"],
|
53
|
-
SERVER_SOFTWARE: req["SERVER_SOFTWARE"]
|
53
|
+
SERVER_SOFTWARE: req["SERVER_SOFTWARE"],
|
54
|
+
SERVER_PORT: req["SERVER_PORT"]
|
54
55
|
}
|
55
56
|
table = generate_table(new_req, "REQUEST")
|
56
57
|
puts table
|
data/lib/logging_good/version.rb
CHANGED
data/logging_good.gemspec
CHANGED
@@ -26,6 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
27
|
spec.add_development_dependency "unicode-display_width", '~> 1.6'
|
28
28
|
spec.add_development_dependency "terminal-table", '~> 1.8', '>= 1.8.0'
|
29
|
+
spec.add_development_dependency 'figaro', '~> 1.1', '>= 1.1.1'
|
30
|
+
spec.add_development_dependency 'codecov'
|
29
31
|
|
30
32
|
spec.add_runtime_dependency "terminal-table", '~> 1.8'
|
31
33
|
spec.add_runtime_dependency "unicode-display_width", '~> 1.6'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logging_good
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manoj Naidu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,6 +86,40 @@ dependencies:
|
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 1.8.0
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: figaro
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.1'
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 1.1.1
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '1.1'
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 1.1.1
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: codecov
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
type: :development
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
89
123
|
- !ruby/object:Gem::Dependency
|
90
124
|
name: terminal-table
|
91
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,6 +163,7 @@ files:
|
|
129
163
|
- Gemfile
|
130
164
|
- Gemfile.lock
|
131
165
|
- LICENSE.txt
|
166
|
+
- Logging-Good.gif
|
132
167
|
- README.md
|
133
168
|
- Rakefile
|
134
169
|
- bin/console
|