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 +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +10 -3
- data/CHANGELOG.md +5 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +17 -19
- data/README.md +7 -19
- data/lib/null_logger.rb +87 -27
- data/lib/null_logger/version.rb +1 -1
- data/null-logger.gemspec +1 -1
- metadata +3 -4
- data/Rakefile +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 148dcf1f7a434633cc943ac6ee27a1916692cdcd9ecbf04e89b9e04e3b1068ea
|
4
|
+
data.tar.gz: 45580a1ba4d4e08b90c93fdda96163cf729b9313fb45e12acaa6da83d6003f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dee771ad0351a9183a85ecbf81d5bf1401f97245571ad5b5165219172fabd8f1b8ddb32b65e898c8584a7374ee86525461c270bb64ab82fe68e9185e32c3925
|
7
|
+
data.tar.gz: e952136d3488ff7fe4259c0bc8fa4fb377cf20b59ea6b604e5304f96f7c30f3a08bb2b4fecc8d978e152a315de11ba86323d332e4897cf4254ecba067d849bac
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.0
|
data/.travis.yml
CHANGED
@@ -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
|
-
|
11
|
-
-
|
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
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,42 +1,40 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
null-logger (0.1.
|
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.
|
10
|
+
docile (1.3.0)
|
11
11
|
json (2.1.0)
|
12
|
-
|
13
|
-
|
14
|
-
rspec-
|
15
|
-
rspec-
|
16
|
-
|
17
|
-
|
18
|
-
|
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.
|
22
|
-
rspec-mocks (3.
|
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.
|
25
|
-
rspec-support (3.
|
26
|
-
simplecov (0.
|
27
|
-
docile (~> 1.1
|
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.
|
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.
|
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
|
50
|
+
* [Null Logger Coditsu](https://app.coditsu.io/karafka/repositories/null-logger)
|
56
51
|
|
57
|
-
## Note on
|
52
|
+
## Note on contributions
|
58
53
|
|
59
|
-
|
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
|
-
|
56
|
+
Each pull request must pass all the rspec specs and meet our quality requirements.
|
65
57
|
|
66
|
-
|
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
|
-
|
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
|
-
|
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)
|
data/lib/null_logger.rb
CHANGED
@@ -1,32 +1,92 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Null logger class
|
4
|
-
#
|
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
|
-
#
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
# @
|
19
|
-
def
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
#
|
24
|
-
#
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
data/lib/null_logger/version.rb
CHANGED
data/null-logger.gemspec
CHANGED
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
|
+
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:
|
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
|
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.
|