sherlog-holmes 0.4.1 → 0.5.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/README.md +4 -4
- data/bin/sherlog +2 -2
- data/changelog.md +8 -0
- data/conf/patterns/java.yml +1 -1
- data/lib/sherlog_holmes/listeners/count_listener.rb +13 -13
- data/lib/sherlog_holmes/version.rb +1 -1
- data/sherlog-holmes.gemspec +2 -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: 335c0ae3ce2274c0771f5c2936f699d846fbfb71
|
|
4
|
+
data.tar.gz: 38d8ee3302d9414b2e86d1236b7790a2feec23ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b04ce754d419cef4afd09cd2e7646dec963b36c7f0905e591a124df012cf6053502d29e532b389d0e9d65abaa045adfb7692b042403344074bd229057616d492
|
|
7
|
+
data.tar.gz: 13004cc6b7f9d720f4ae01a952102411177b537302d9c1280e5bdc25ae1ed8b7df73ba8a349358e6ed30f51b1519ad91d512e462b22aef5b19beca055bba51e2
|
data/README.md
CHANGED
|
@@ -163,10 +163,10 @@ This will instruct Sherlog to not print stacktraces for entries. This only has e
|
|
|
163
163
|
|
|
164
164
|
Set this and Sherlog will count the number of entries per level, category, origin or exception. The possible parameters are (separated by a `,`):
|
|
165
165
|
|
|
166
|
-
- `
|
|
167
|
-
- `
|
|
168
|
-
- `
|
|
169
|
-
- `
|
|
166
|
+
- `level`: counts the number of entries per level
|
|
167
|
+
- `category`: counts the number of entries per category
|
|
168
|
+
- `origin`: counts the number of entries per origin
|
|
169
|
+
- `exception`: counts the number of entries per exception
|
|
170
170
|
- `all`: counts all groups
|
|
171
171
|
|
|
172
172
|
```
|
data/bin/sherlog
CHANGED
|
@@ -133,9 +133,9 @@ end
|
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
@opts.on '--count GROUPS...',
|
|
136
|
-
'Counts entries and print the result by group (
|
|
136
|
+
'Counts entries and print the result by group (level, category, origin, exception or all)',
|
|
137
137
|
Array do |groups|
|
|
138
|
-
all_groups = [:
|
|
138
|
+
all_groups = [:level, :category, :origin, :exception]
|
|
139
139
|
@groups = if groups == ['all']
|
|
140
140
|
all_groups
|
|
141
141
|
else
|
data/changelog.md
CHANGED
data/conf/patterns/java.yml
CHANGED
|
@@ -3,7 +3,7 @@ base.java:
|
|
|
3
3
|
stacktrace: ^(\s+at)|(Caused by\:)|(\s+\.{3}\s\d+\smore)
|
|
4
4
|
jboss:
|
|
5
5
|
from: base.java
|
|
6
|
-
entry: (?<time>(?<date>\d{2,4}-\d{2}-\d{2,4}\s)?(\d{2}:\d{2}:\d{2},\d{3}))\s
|
|
6
|
+
entry: (?<time>(?<date>\d{2,4}-\d{2}-\d{2,4}\s)?(\d{2}:\d{2}:\d{2},\d{3}))\s+\|?\s*(?<level>\w+)\s+\|?\s*\[(?<category>\S+)\]\s+\|?\s*\((?<origin>[^)]+)\)?\s?\|?\s?(?<message>.+)
|
|
7
7
|
jboss.fuse:
|
|
8
8
|
from: base.java
|
|
9
9
|
entry: (?<time>(?<date>\d{2,4}-\d{2}-\d{2,4}\s)?(\d{2}:\d{2}:\d{2},\d{3}))\s+\|\s*(?<level>\w+)\s*\|\s*(?<origin>[^|]+)\s*\|\s*(?<category>[^|]+)\s*\|\s*(?<bundle>(?<bundle_id>\d+) - (?<bundle_name>\S+) - (?<bundle_version>\S+))\s*\|\s*(?<message>.+)
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
module Sherlog
|
|
24
24
|
|
|
25
25
|
class CountListener
|
|
26
|
-
attr_reader :
|
|
26
|
+
attr_reader :level, :category, :origin, :exception
|
|
27
27
|
|
|
28
28
|
def initialize
|
|
29
|
-
@
|
|
30
|
-
@
|
|
31
|
-
@
|
|
32
|
-
@
|
|
29
|
+
@level = {}
|
|
30
|
+
@category = {}
|
|
31
|
+
@origin = {}
|
|
32
|
+
@exception = {}
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def call(entry)
|
|
@@ -40,20 +40,20 @@ module Sherlog
|
|
|
40
40
|
private
|
|
41
41
|
|
|
42
42
|
def initialize_counters(entry)
|
|
43
|
-
@
|
|
44
|
-
@
|
|
45
|
-
@
|
|
43
|
+
@level[entry.level] ||= 0 if entry.level
|
|
44
|
+
@category[entry.category] ||= 0 if entry.category
|
|
45
|
+
@origin[entry.origin] ||= 0 if entry.origin
|
|
46
46
|
entry.exceptions.each do |exception|
|
|
47
|
-
@
|
|
47
|
+
@exception[exception] ||= 0
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def count(entry)
|
|
52
|
-
@
|
|
53
|
-
@
|
|
54
|
-
@
|
|
52
|
+
@level[entry.level] += 1 if entry.level
|
|
53
|
+
@category[entry.category] += 1 if entry.category
|
|
54
|
+
@origin[entry.origin] += 1 if entry.origin
|
|
55
55
|
entry.exceptions.each do |exception|
|
|
56
|
-
@
|
|
56
|
+
@exception[exception] += 1
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
|
data/sherlog-holmes.gemspec
CHANGED
|
@@ -9,7 +9,8 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ['Ataxexe']
|
|
10
10
|
spec.email = ['ataxexe@devnull.tools']
|
|
11
11
|
|
|
12
|
-
spec.summary = %q{The best companion
|
|
12
|
+
spec.summary = %q{The best companion of a log detective!}
|
|
13
|
+
|
|
13
14
|
spec.homepage = 'https://github.com/devnull-tools/sherlog-holmes'
|
|
14
15
|
spec.license = 'MIT'
|
|
15
16
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sherlog-holmes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ataxexe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: yummi
|
|
@@ -126,5 +126,5 @@ rubyforge_project:
|
|
|
126
126
|
rubygems_version: 2.4.6
|
|
127
127
|
signing_key:
|
|
128
128
|
specification_version: 4
|
|
129
|
-
summary: The best companion
|
|
129
|
+
summary: The best companion of a log detective!
|
|
130
130
|
test_files: []
|