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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfabfad5c19ca3571ca67c3a4aab466b8018cc0c
4
- data.tar.gz: a5a3e6f5657835d46abd367894e565e52be653aa
3
+ metadata.gz: 335c0ae3ce2274c0771f5c2936f699d846fbfb71
4
+ data.tar.gz: 38d8ee3302d9414b2e86d1236b7790a2feec23ae
5
5
  SHA512:
6
- metadata.gz: 29626eaaaa8f34cc6c40ea9a7942ce361f134db9c96ddf7915c7505a0c8fa88ac513982a45f07e9f06d22c9fe8f65f9fab9af0b670de08a9f5dcc13c4d3a7e96
7
- data.tar.gz: 527afcbc462f5b0acf2f77cdadc04a55726f9510308533f8f79101a97c18cbcd19a3fe92ccd946ee52c68f0e76cbcdac7c681792750a08b6c1e4977e46b8d7a4
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
- - `levels`: counts the number of entries per level
167
- - `categories`: counts the number of entries per category
168
- - `origins`: counts the number of entries per origin
169
- - `exceptions`: counts the number of entries per exception
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
  ```
@@ -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 (levels, categories, origins, exceptions or all)',
136
+ 'Counts entries and print the result by group (level, category, origin, exception or all)',
137
137
  Array do |groups|
138
- all_groups = [:levels, :categories, :origins, :exceptions]
138
+ all_groups = [:level, :category, :origin, :exception]
139
139
  @groups = if groups == ['all']
140
140
  all_groups
141
141
  else
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.5.1
4
+
5
+ - Accept JBoss log entries that uses a '|' between attributes
6
+
7
+ ## v0.5.0
8
+
9
+ - Use singular attributes in group option
10
+
3
11
  ## v0.4.1
4
12
 
5
13
  - Use `optparse` instead of `optionparser`
@@ -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+(?<level>\w+)\s+\[(?<category>\S+)\]\s\((?<origin>[^)]+)\)?\s?(?<message>.+)
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 :levels, :categories, :origins, :exceptions
26
+ attr_reader :level, :category, :origin, :exception
27
27
 
28
28
  def initialize
29
- @levels = {}
30
- @categories = {}
31
- @origins = {}
32
- @exceptions = {}
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
- @levels[entry.level] ||= 0 if entry.level
44
- @categories[entry.category] ||= 0 if entry.category
45
- @origins[entry.origin] ||= 0 if entry.origin
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
- @exceptions[exception] ||= 0
47
+ @exception[exception] ||= 0
48
48
  end
49
49
  end
50
50
 
51
51
  def count(entry)
52
- @levels[entry.level] += 1 if entry.level
53
- @categories[entry.category] += 1 if entry.category
54
- @origins[entry.origin] += 1 if entry.origin
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
- @exceptions[exception] += 1
56
+ @exception[exception] += 1
57
57
  end
58
58
  end
59
59
 
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Sherlog
24
- VERSION = '0.4.1'
24
+ VERSION = '0.5.1'
25
25
  end
@@ -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 for a log detective!}
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.1
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-01-08 00:00:00.000000000 Z
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 for a log detective!
129
+ summary: The best companion of a log detective!
130
130
  test_files: []