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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62c09bdc6435b8ec58846e5edf4a8f973fb8786c
4
- data.tar.gz: bd9a8d13d32cb9cd36dcc18a3ede821ed023a03e
3
+ metadata.gz: 94818d828e7a160ff2c2575973b5fb85d69c43a3
4
+ data.tar.gz: d028ccafe9dc25c283feddfcae1d80f3b760ed3d
5
5
  SHA512:
6
- metadata.gz: 5e90e2e0ff25708728049d0042f3e8aa813a8f2843fa573a028234c8525f564854b3e4d6a494c14be456e628b25619668afc1f49adf3b166e04a593bf01ab0dd
7
- data.tar.gz: fd82989263a6f6d4a981c5d5e992a5b7ebc6d4fd5a2d837b50760d17590159bd0fa7e08cdb548e7722b57d1795c302bda8f4e45da91e448aedbb2a7cda46d4a4
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
+ ![Image of Normal Rails Log](http://i.imgur.com/UtmFpyt.png)
6
+
7
+ To this
8
+ ![Image of Rails Log with Minimal Logging](http://i.imgur.com/o1fYDre.png)
9
+
5
10
  ## Installation
6
11
 
7
- Add this line to your application's Gemfile:
12
+ Add this to your application's Gemfile:
8
13
 
9
14
  ```ruby
10
- gem 'minimal_logging'
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 as:
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
- 1. Installing the [quiet assets gem](https://github.com/evrone/quiet_assets) to remove noisy logging from your assets.
25
- 2. Setting your log_level to `:info`
26
- In config/environments/development.rb
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.log_level = :info
39
+ config.minimal_logging.enabled = false
29
40
  ```
30
41
 
31
42
  ## Contributing
32
43
 
33
- 1. Fork it ( https://github.com/[my-github-username]/minimal_logging/fork )
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`)
@@ -1,11 +1,30 @@
1
1
  require "minimal_logging/version"
2
2
 
3
3
  module MinimalLogging
4
- def self.setup(app)
5
- require "minimal_logging/rails_extensions/action_view_log_subscriber_extension.rb"
6
- require "minimal_logging/rails_extensions/filter_parameters_extension.rb"
7
- require "minimal_logging/rails_extensions/log_subscriber_extension.rb"
8
- require "minimal_logging/rails_extensions/logger_extension.rb"
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 = false
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
@@ -1,3 +1,3 @@
1
1
  module MinimalLogging
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -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 = ["Scott.D.Nelson@dartmouth.edu"]
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
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-07 00:00:00.000000000 Z
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
- - Scott.D.Nelson@dartmouth.edu
71
+ - scott@scottdavidnelson.io
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []