minimal_logging 0.0.4 → 0.0.5
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/README.md +21 -10
- data/lib/minimal_logging.rb +24 -5
- data/lib/minimal_logging/railtie.rb +2 -1
- data/lib/minimal_logging/version.rb +1 -1
- data/minimal_logging.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94818d828e7a160ff2c2575973b5fb85d69c43a3
|
4
|
+
data.tar.gz: d028ccafe9dc25c283feddfcae1d80f3b760ed3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ed2626c685bbf17545a128a9bd3dbdf900fdec93082f42549c1b1f92076d9b0f6fe06f74b85bc784d690a5cdb6b779533e0827fe38b8d5740a9ccb5ff0793c9
|
7
|
+
data.tar.gz: 58331c5a6fe4b2714085293c5dff5879e7fed571854ef1881e7d58a95465b88bb2ff990975165633a4e21d537e96ad23af1b20d0ea5444877ed93f9fea1db4f7
|
data/README.md
CHANGED
@@ -1,36 +1,47 @@
|
|
1
1
|
# MinimalLogging
|
2
|
-
|
3
2
|
Minimal Logging removes some of the noise from the Rails Server log so you can focus on the most important events. It also formats parameters and actions in a more readable way to quickly see what's going on.
|
4
3
|
|
4
|
+
So you can go from this
|
5
|
+

|
6
|
+
|
7
|
+
To this
|
8
|
+

|
9
|
+
|
5
10
|
## Installation
|
6
11
|
|
7
|
-
Add this
|
12
|
+
Add this to your application's Gemfile:
|
8
13
|
|
9
14
|
```ruby
|
10
|
-
|
15
|
+
group :development do
|
16
|
+
gem 'minimal_logging'
|
17
|
+
end
|
11
18
|
```
|
12
19
|
|
13
20
|
And then execute:
|
14
21
|
|
15
22
|
$ bundle
|
16
23
|
|
17
|
-
Or install it yourself
|
24
|
+
Or install it yourself:
|
18
25
|
|
19
26
|
$ gem install minimal_logging
|
20
27
|
|
21
28
|
## Usage
|
22
29
|
|
23
|
-
For best results I also recommend
|
24
|
-
|
25
|
-
|
26
|
-
|
30
|
+
For best results I also recommend installing the [quiet assets gem](https://github.com/evrone/quiet_assets) to remove noisy logging from your assets.
|
31
|
+
|
32
|
+
By default, minimal_logging will change your log_level to :info. If you want to set the log_level yourself, you can turn off this behavior (either in application.rb or development.rb in config).
|
33
|
+
```ruby
|
34
|
+
config.minimal_logging.change_log_level = false
|
35
|
+
```
|
36
|
+
|
37
|
+
If you need a more verbose log, you can turn off minimal_logging at any time.
|
27
38
|
```ruby
|
28
|
-
config.
|
39
|
+
config.minimal_logging.enabled = false
|
29
40
|
```
|
30
41
|
|
31
42
|
## Contributing
|
32
43
|
|
33
|
-
1. Fork it ( https://github.com/
|
44
|
+
1. Fork it ( https://github.com/nelsonscott/minimal_logging/fork )
|
34
45
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
35
46
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
36
47
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/minimal_logging.rb
CHANGED
@@ -1,11 +1,30 @@
|
|
1
1
|
require "minimal_logging/version"
|
2
2
|
|
3
3
|
module MinimalLogging
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
|
5
|
+
class << self
|
6
|
+
attr_accessor :app
|
7
|
+
|
8
|
+
def setup(app)
|
9
|
+
self.app = app
|
10
|
+
set_log_level
|
11
|
+
apply_log_filters
|
12
|
+
end
|
13
|
+
|
14
|
+
def set_log_level
|
15
|
+
Rails.logger.level = 1 if minimal_config.change_log_level
|
16
|
+
end
|
17
|
+
|
18
|
+
def apply_log_filters
|
19
|
+
require "minimal_logging/rails_extensions/action_view_log_subscriber_extension.rb"
|
20
|
+
require "minimal_logging/rails_extensions/filter_parameters_extension.rb"
|
21
|
+
require "minimal_logging/rails_extensions/log_subscriber_extension.rb"
|
22
|
+
require "minimal_logging/rails_extensions/logger_extension.rb"
|
23
|
+
end
|
24
|
+
|
25
|
+
def minimal_config
|
26
|
+
app.config.minimal_logging
|
27
|
+
end
|
9
28
|
end
|
10
29
|
|
11
30
|
require 'minimal_logging/railtie' if defined?(Rails)
|
@@ -3,7 +3,8 @@ require 'rails/railtie'
|
|
3
3
|
module MinimalLogging
|
4
4
|
class Railtie < Rails::Railtie
|
5
5
|
config.minimal_logging = ActiveSupport::OrderedOptions.new
|
6
|
-
config.minimal_logging.enabled =
|
6
|
+
config.minimal_logging.enabled = true
|
7
|
+
config.minimal_logging.change_log_level = true
|
7
8
|
|
8
9
|
config.after_initialize do |app|
|
9
10
|
MinimalLogging.setup(app) if app.config.minimal_logging.enabled
|
data/minimal_logging.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "minimal_logging"
|
8
8
|
spec.version = MinimalLogging::VERSION
|
9
9
|
spec.authors = ["Scott Nelson"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["scott@scottdavidnelson.io"]
|
11
11
|
spec.summary = %q{Replace the default Rails Server log with shorter and more readable output.}
|
12
12
|
spec.description = %q{Replace the default Rails Server log with shorter and more readable output.}
|
13
13
|
spec.homepage = "https://github.com/NelsonScott/minimal_logging"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimal_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
version: '0.7'
|
69
69
|
description: Replace the default Rails Server log with shorter and more readable output.
|
70
70
|
email:
|
71
|
-
-
|
71
|
+
- scott@scottdavidnelson.io
|
72
72
|
executables: []
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|