null-logger 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bb46a333d77b31236b9b3e071244d02a3eba700e
4
- data.tar.gz: 48afc3f414bc22b2c8f86b925caee3132b8a8bcf
2
+ SHA256:
3
+ metadata.gz: 148dcf1f7a434633cc943ac6ee27a1916692cdcd9ecbf04e89b9e04e3b1068ea
4
+ data.tar.gz: 45580a1ba4d4e08b90c93fdda96163cf729b9313fb45e12acaa6da83d6003f60
5
5
  SHA512:
6
- metadata.gz: 3cc144000c3ca3af691c6d9673c01829c869c05e9f28f9a1c7d02ba8091c0637fbe2b8ce06043d10aee1323601e63659e91e9820ed10579c0efdb3dc5379c4f2
7
- data.tar.gz: 1fc286f6d4bc649be4f8a069c2f7e3d0abfff8bc369fd0b19ad90fd7e37345be7506cd97026f9ad1cfd17f5c31340862986c5cbf94f70d9a30f37f6392bc86d4
6
+ metadata.gz: 1dee771ad0351a9183a85ecbf81d5bf1401f97245571ad5b5165219172fabd8f1b8ddb32b65e898c8584a7374ee86525461c270bb64ab82fe68e9185e32c3925
7
+ data.tar.gz: e952136d3488ff7fe4259c0bc8fa4fb377cf20b59ea6b604e5304f96f7c30f3a08bb2b4fecc8d978e152a315de11ba86323d332e4897cf4254ecba067d849bac
@@ -1 +1 @@
1
- 2.4.1
1
+ 2.5.0
@@ -1,11 +1,18 @@
1
1
  language: ruby
2
+ sudo: false
2
3
  rvm:
3
- - 2.2.3
4
4
  - 2.3.0
5
5
  - 2.3.1
6
6
  - 2.3.2
7
7
  - 2.3.3
8
+ - 2.3.4
8
9
  - 2.4.0
9
10
  - 2.4.1
10
- script:
11
- - bundle exec rake
11
+ - 2.4.2
12
+ - 2.5.0
13
+ - jruby-head
14
+ script: bundle exec rspec spec/
15
+ env:
16
+ global:
17
+ - JRUBY_OPTS='--debug'
18
+ install: bundle install --jobs=3 --retry=3
@@ -1,5 +1,10 @@
1
1
  # Null-Logger changelog
2
2
 
3
+ ## 0.1.5 Unreleased
4
+ - Ruby 2.4.2 support
5
+ - #5 - Could be faster
6
+ - Ruby 2.5.0 support
7
+
3
8
  ## 0.1.4
4
9
  - Ruby 2.4.1 as default
5
10
  - Gem bump
data/Gemfile CHANGED
@@ -7,5 +7,4 @@ gemspec
7
7
  group :development, :test do
8
8
  gem 'rspec'
9
9
  gem 'simplecov'
10
- gem 'rake'
11
10
  end
@@ -1,42 +1,40 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- null-logger (0.1.4)
4
+ null-logger (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  diff-lcs (1.3)
10
- docile (1.1.5)
10
+ docile (1.3.0)
11
11
  json (2.1.0)
12
- rake (12.0.0)
13
- rspec (3.5.0)
14
- rspec-core (~> 3.5.0)
15
- rspec-expectations (~> 3.5.0)
16
- rspec-mocks (~> 3.5.0)
17
- rspec-core (3.5.4)
18
- rspec-support (~> 3.5.0)
19
- rspec-expectations (3.5.0)
12
+ rspec (3.7.0)
13
+ rspec-core (~> 3.7.0)
14
+ rspec-expectations (~> 3.7.0)
15
+ rspec-mocks (~> 3.7.0)
16
+ rspec-core (3.7.1)
17
+ rspec-support (~> 3.7.0)
18
+ rspec-expectations (3.7.0)
20
19
  diff-lcs (>= 1.2.0, < 2.0)
21
- rspec-support (~> 3.5.0)
22
- rspec-mocks (3.5.0)
20
+ rspec-support (~> 3.7.0)
21
+ rspec-mocks (3.7.0)
23
22
  diff-lcs (>= 1.2.0, < 2.0)
24
- rspec-support (~> 3.5.0)
25
- rspec-support (3.5.0)
26
- simplecov (0.14.1)
27
- docile (~> 1.1.0)
23
+ rspec-support (~> 3.7.0)
24
+ rspec-support (3.7.1)
25
+ simplecov (0.16.1)
26
+ docile (~> 1.1)
28
27
  json (>= 1.8, < 3)
29
28
  simplecov-html (~> 0.10.0)
30
- simplecov-html (0.10.0)
29
+ simplecov-html (0.10.2)
31
30
 
32
31
  PLATFORMS
33
32
  ruby
34
33
 
35
34
  DEPENDENCIES
36
35
  null-logger!
37
- rake
38
36
  rspec
39
37
  simplecov
40
38
 
41
39
  BUNDLED WITH
42
- 1.14.6
40
+ 1.16.1
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Null Logger
2
2
 
3
3
  [![Build Status](https://travis-ci.org/karafka/null-logger.svg?branch=master)](https://travis-ci.org/karafka/null-logger)
4
- [![Code Climate](https://codeclimate.com/github/karafka/null-logger/badges/gpa.svg)](https://codeclimate.com/github/karafka/null-logger)
5
- [![Gem Version](https://badge.fury.io/rb/null-logger.svg)](http://badge.fury.io/rb/null-logger)
6
4
  [![Join the chat at https://gitter.im/karafka/karafka](https://badges.gitter.im/karafka/karafka.svg)](https://gitter.im/karafka/karafka?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
5
 
8
6
  A simple logger that does not log anything. It can be used for defining an interface for other loggers.
@@ -48,27 +46,17 @@ NullLogger define interface for real logger instance, ex:
48
46
  ## References
49
47
 
50
48
  * [Karafka framework](https://github.com/karafka/karafka)
51
- * [Waterdrop](https://github.com/karafka/waterdrop)
52
- * [Worker Glass](https://github.com/karafka/worker-glass)
53
- * [Envlogic](https://github.com/karafka/envlogic)
54
49
  * [Null Logger Travis CI](https://travis-ci.org/karafka/null-logger)
55
- * [Null Logger Code Climate](https://codeclimate.com/github/karafka/null-logger)
50
+ * [Null Logger Coditsu](https://app.coditsu.io/karafka/repositories/null-logger)
56
51
 
57
- ## Note on Patches/Pull Requests
52
+ ## Note on contributions
58
53
 
59
- Fork the project.
60
- Make your feature addition or bug fix.
61
- Add tests for it. This is important so I don't break it in a future version unintentionally.
62
- Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull). Send me a pull request. Bonus points for topic branches.
54
+ First, thank you for considering contributing to NullLogger! It's people like you that make the open source community such a great community!
63
55
 
64
- [![coditsu](https://coditsu.io/assets/quality_bar.svg)](https://coditsu.io)
56
+ Each pull request must pass all the rspec specs and meet our quality requirements.
65
57
 
66
- Each pull request must pass our quality requirements. To check if everything is as it should be, we use [Coditsu](https://coditsu.io) that combinse multiple linters and code analyzers. Unfortunately, for now it is invite-only based, so just ping us and we will give you access to the quality results.
58
+ To check if everything is as it should be, we use [Coditsu](https://coditsu.io) that combines multiple linters and code analyzers for both code and documentation. Once you're done with your changes, submit a pull request.
67
59
 
68
- Please run:
60
+ Coditsu will automatically check your work against our quality standards. You can find your commit check results on the [builds page](https://app.coditsu.io/karafka/repositories/null-logger/builds/commit_builds) of NullLogger repository.
69
61
 
70
- ```bash
71
- bundle exec rake
72
- ```
73
-
74
- to check if everything is in order. After that you can submit a pull request.
62
+ [![coditsu](https://coditsu.io/assets/quality_bar.svg)](https://app.coditsu.io/karafka/repositories/null-logger/builds/commit_builds)
@@ -1,32 +1,92 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Null logger class
4
- # Is used when logger is not defined
3
+ # Null logger class. This is essentially the same as sending data down the
4
+ # `/dev/null` blackhole.
5
+ #
6
+ # @example Basic Usage
7
+ #
8
+ # logger = NullLogger.new
9
+ # Rails.logger = logger
10
+ #
11
+ #
12
+ # @example Basic Pattern Usage
13
+ # class SomeService
14
+ # def initialize(options = {})
15
+ # @logger = options[:logger] || NullLogger.new
16
+ # end
17
+ #
18
+ # def perform
19
+ # @logger.debug -> { "do some work here" }
20
+ # # .. ..
21
+ # @logger.info -> { "finished working" }
22
+ # end
23
+ # end
24
+ #
25
+ # service = SomeService.new(logger: Logger.new(STDOUT))
26
+ # service.perform
27
+ #
28
+ # silent = SomeService.new(logger: NullLogger.new
29
+ # silent.perform
30
+ #
5
31
  class NullLogger
6
- # Possible log levels from ruby Logger::Severity class
7
- LOG_LEVELS = %w[
8
- unknown
9
- fatal
10
- error
11
- warn
12
- info
13
- debug
14
- ].freeze
15
-
16
- # @return [Boolean] true if we can handle this missing method, otherwise false
17
- # @param method_name [String, Symbol] method name
18
- # @param include_private [Boolean] should we include private methods as well
19
- def respond_to_missing?(method_name, include_private = false)
20
- LOG_LEVELS.include?(method_name.to_s) || super
21
- end
22
-
23
- # Returns nil for any method call from LOG_LEVELS array
24
- # Instead raise NoMethodError
25
- # @example:
26
- # NullLogger.new.fatal -> return nil
27
- # NullLogger.new.wrong_method -> raise NoMethodError
28
- def method_missing(method_name, *args, &block)
29
- return nil if LOG_LEVELS.include?(method_name.to_s)
30
- super
32
+ # @param _args Anything that we want to ignore
33
+ # @return [nil]
34
+ def unknown(*_args)
35
+ nil
36
+ end
37
+
38
+ # @param _args Anything that we want to ignore
39
+ # @return [nil]
40
+ def fatal(*_args)
41
+ nil
42
+ end
43
+
44
+ # @return [FALSE]
45
+ def fatal?
46
+ false
47
+ end
48
+
49
+ # @param _args Anything that we want to ignore
50
+ # @return [nil]
51
+ def error(*_args)
52
+ nil
53
+ end
54
+
55
+ # @return [FALSE]
56
+ def error?
57
+ false
58
+ end
59
+
60
+ # @param _args Anything that we want to ignore
61
+ # @return [nil]
62
+ def warn(*_args)
63
+ nil
64
+ end
65
+
66
+ # @return [FALSE]
67
+ def warn?
68
+ false
69
+ end
70
+
71
+ # @param _args Anything that we want to ignore
72
+ # @return [nil]
73
+ def info(*_args)
74
+ nil
75
+ end
76
+
77
+ # @return [FALSE]
78
+ def info?
79
+ false
80
+ end
81
+
82
+ # @param _args Anything that we want to ignore
83
+ # @return [nil]
84
+ def debug(*_args)
85
+ nil
86
+ end
87
+
88
+ # @return [FALSE]
89
+ def debug?
90
+ false
31
91
  end
32
92
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  class NullLogger
4
4
  # null-logger gem Version
5
- VERSION = '0.1.4'
5
+ VERSION = '0.1.5'
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  require 'null_logger/version'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: null-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-02 00:00:00.000000000 Z
12
+ date: 2018-03-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: It can be used for defining an interface for other loggers
15
15
  email:
@@ -29,7 +29,6 @@ files:
29
29
  - Gemfile.lock
30
30
  - MIT-LICENCE
31
31
  - README.md
32
- - Rakefile
33
32
  - lib/null_logger.rb
34
33
  - lib/null_logger/version.rb
35
34
  - null-logger.gemspec
@@ -53,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
52
  version: '0'
54
53
  requirements: []
55
54
  rubyforge_project:
56
- rubygems_version: 2.6.11
55
+ rubygems_version: 2.7.6
57
56
  signing_key:
58
57
  specification_version: 4
59
58
  summary: A simple logger that does not log anything.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler'
4
- require 'bundler/gem_tasks'
5
- require 'rspec/core/rake_task'
6
- require 'rake'
7
-
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- task default: :spec