groonga-log 0.1.0 → 0.1.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/lib/groonga-log/parser.rb +9 -7
- data/lib/groonga-log/statistic.rb +0 -16
- data/lib/groonga-log/version.rb +1 -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: 1b1b31515ef1d36933fa60b2cb757781d306b03f
|
|
4
|
+
data.tar.gz: 6af04a58da72335c8256f7b7c329037088542108
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eec6d9d2e88d62981c0d0435bf99f2de568306aa574e1640e9187f43c38bf9656b4fd868ed28c7841d38619f1d94de7caa69660debc9d5279f191c19e6a04b0b
|
|
7
|
+
data.tar.gz: c479b592f4ac6b6137b07e7e6073ef541f1a92db3e671a1123c1d41585ee4138cdff5dd1f4c9828373a9f69549e66d282864bb0ebf7b506a4c76cb951dab9694
|
data/lib/groonga-log/parser.rb
CHANGED
|
@@ -34,13 +34,15 @@ module GroongaLog
|
|
|
34
34
|
m = PATTERN.match(line)
|
|
35
35
|
|
|
36
36
|
statistic = Statistic.new
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
year = m['year'].to_i
|
|
38
|
+
month = m['month'].to_i
|
|
39
|
+
day = m['day'].to_i
|
|
40
|
+
hour = m['hour'].to_i
|
|
41
|
+
minute = m['minute'].to_i
|
|
42
|
+
second = m['second'].to_i
|
|
43
|
+
micro_second = m['micro_second'].to_i
|
|
44
|
+
statistic.timestamp = Time.local(year, month, day,
|
|
45
|
+
hour, minute, second, micro_second)
|
|
44
46
|
statistic.log_level = log_level_to_symbol(m['log_level'])
|
|
45
47
|
statistic.context_id = m['context_id']
|
|
46
48
|
statistic.message = m['message']
|
|
@@ -16,24 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
module GroongaLog
|
|
18
18
|
class Statistic < Struct.new(:timestamp,
|
|
19
|
-
:year,
|
|
20
|
-
:month,
|
|
21
|
-
:day,
|
|
22
|
-
:hour,
|
|
23
|
-
:minute,
|
|
24
|
-
:second,
|
|
25
|
-
:micro_second,
|
|
26
19
|
:log_level,
|
|
27
20
|
:context_id,
|
|
28
21
|
:message)
|
|
29
|
-
def timestamp
|
|
30
|
-
super || Time.local(year, month, day, hour, minute, second, micro_second)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def to_h
|
|
34
|
-
hash = super
|
|
35
|
-
hash[:timestamp] ||= timestamp
|
|
36
|
-
hash
|
|
37
|
-
end
|
|
38
22
|
end
|
|
39
23
|
end
|
data/lib/groonga-log/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: groonga-log
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Horimoto Yasuhiro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-09-
|
|
11
|
+
date: 2017-09-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
version: '0'
|
|
110
110
|
requirements: []
|
|
111
111
|
rubyforge_project:
|
|
112
|
-
rubygems_version: 2.
|
|
112
|
+
rubygems_version: 2.5.2
|
|
113
113
|
signing_key:
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: Groonga-log is a collection of library and tools to process [Groonga](http://groonga.org/)'s
|