console 1.4.0 → 1.4.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/.editorconfig +6 -0
- data/README.md +20 -0
- data/lib/console/filter.rb +2 -2
- data/lib/console/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34ccd1256430f59ae972ea3759afc6a804eab3178686fdbe094e4835477414bb
|
4
|
+
data.tar.gz: 6c9a306c59fa29b4fa93a71002977a159a89fb00cc3e07a51a92f4ceb91ee706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45b0209e1e0c69399fcafd519f6bc4f6913c2ea3df8afeea63b18a1ef6277b754c161be6d0bb4e2f75ea6358cd63a9063baeb42b8e0195cc231e9abae2e07b25
|
7
|
+
data.tar.gz: 03c0d291a39afc46f44bb19e81d3285cf0f5764ecdd4e1f66121d7d503219ff9bd5b0a15c3acac63e5835ecfdf0376cb27f29724b3c7d835dfdda7b9a5dd9d2c
|
data/.editorconfig
ADDED
data/README.md
CHANGED
@@ -75,6 +75,26 @@ end
|
|
75
75
|
MyObject.new.test_logger
|
76
76
|
```
|
77
77
|
|
78
|
+
### Subject Logging
|
79
|
+
|
80
|
+
The first argument to the log method is the subject.
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
class Thing
|
84
|
+
def call
|
85
|
+
Console.logger.info(self) {"Something is going on"}
|
86
|
+
end
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
90
|
+
Using this approach, you can turn on and off specific subjects by using the class name:
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
$ CONSOLE_DEBUG=Thing ./script.rb
|
94
|
+
```
|
95
|
+
|
96
|
+
This will conditionally enable all log statements which have a subject of class `Thing`.
|
97
|
+
|
78
98
|
### Console Formatting
|
79
99
|
|
80
100
|
Console classes are used to wrap data which can generate structured log messages:
|
data/lib/console/filter.rb
CHANGED
data/lib/console/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: covered
|
@@ -73,6 +73,7 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".editorconfig"
|
76
77
|
- ".gitignore"
|
77
78
|
- ".rspec"
|
78
79
|
- ".travis.yml"
|
@@ -116,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
117
|
- !ruby/object:Gem::Version
|
117
118
|
version: '0'
|
118
119
|
requirements: []
|
119
|
-
rubygems_version: 3.0.
|
120
|
+
rubygems_version: 3.0.4
|
120
121
|
signing_key:
|
121
122
|
specification_version: 4
|
122
123
|
summary: Beautiful logging for Ruby.
|