groonga-log 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/doc/text/news.md +10 -0
- data/lib/groonga-log/entry.rb +1 -0
- data/lib/groonga-log/parser.rb +19 -15
- data/lib/groonga-log/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 25c1995a063dec899eb5fa204533eb9df494b2dd2cde06e4abb05cc1580ae0cc
|
4
|
+
data.tar.gz: 641bb221339794c6d122b103b8c93a8920277690672d71e5a101ac3c1eb39764
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95efa5d957d1837bab8b4bd6a0c96fdeeafeb9f8fc823f8588d9feb80fcc6f401394b6ddedef4407b7691d8ba7eee772c4d2d071129c633b7c4e72b442d99d33
|
7
|
+
data.tar.gz: a7619a5354f6651ab6ef0f214ca0f87792927139dfd18b2f245ffab0cba82393dffcf7691a553a3a88ec79d6eff9bb8fa45f63ba88b7803434948c0958e69141
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 0.1.3: 2018-08-30
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Added support for ignoring broken lines.
|
8
|
+
|
9
|
+
* Added support for Mroonga style log.
|
10
|
+
|
11
|
+
* Added support for both process ID and thread ID case.
|
12
|
+
|
3
13
|
## 0.1.2: 2018-02-04
|
4
14
|
|
5
15
|
### Improvements
|
data/lib/groonga-log/entry.rb
CHANGED
data/lib/groonga-log/parser.rb
CHANGED
@@ -23,10 +23,11 @@ module GroongaLog
|
|
23
23
|
class Parser
|
24
24
|
PATTERN =
|
25
25
|
/\A(?<year>\d{4})-(?<month>\d\d)-(?<day>\d\d)
|
26
|
-
\ (?<hour>\d\d):(?<minute>\d\d):(?<second>\d\d)\.(?<micro_second>\d+)
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
\ (?<hour>\d\d):(?<minute>\d\d):(?<second>\d\d)\.(?<micro_second>\d+)\|
|
27
|
+
(?<log_level>.)\|
|
28
|
+
(?:(?<pid>\d+)[|:])?
|
29
|
+
(?:(?<thread_id>[\da-fA-F]+)[|:])?
|
30
|
+
\ ?(?<message>[^\r\n]*)/x
|
30
31
|
PATH_TIMESTAMP_PATTERN = /(\d{4})-(\d{2})-(\d{2})-
|
31
32
|
(\d{2})-(\d{2})-(\d{2})-(\d{6})
|
32
33
|
(?:\.(?:gz|zip))?\z/xi
|
@@ -68,22 +69,25 @@ module GroongaLog
|
|
68
69
|
next unless line.valid_encoding?
|
69
70
|
end
|
70
71
|
|
71
|
-
|
72
|
+
match_data = PATTERN.match(line)
|
73
|
+
next if match_data.nil?
|
72
74
|
|
73
75
|
entry = Entry.new
|
74
76
|
|
75
|
-
year =
|
76
|
-
month =
|
77
|
-
day =
|
78
|
-
hour =
|
79
|
-
minute =
|
80
|
-
second =
|
81
|
-
micro_second =
|
77
|
+
year = Integer(match_data[:year], 10)
|
78
|
+
month = Integer(match_data[:month], 10)
|
79
|
+
day = Integer(match_data[:day], 10)
|
80
|
+
hour = Integer(match_data[:hour], 10)
|
81
|
+
minute = Integer(match_data[:minute], 10)
|
82
|
+
second = Integer(match_data[:second], 10)
|
83
|
+
micro_second = Integer(match_data[:micro_second], 10)
|
82
84
|
entry.timestamp = Time.local(year, month, day,
|
83
85
|
hour, minute, second, micro_second)
|
84
|
-
entry.log_level = log_level_to_symbol(
|
85
|
-
|
86
|
-
entry.
|
86
|
+
entry.log_level = log_level_to_symbol(match_data[:log_level])
|
87
|
+
pid = match_data[:pid]
|
88
|
+
entry.pid = Integer(pid, 10) if pid
|
89
|
+
entry.thread_id = match_data[:thread_id]
|
90
|
+
entry.message = match_data[:message]
|
87
91
|
yield entry
|
88
92
|
end
|
89
93
|
end
|
data/lib/groonga-log/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Horimoto Yasuhiro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: archive-zip
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version:
|
116
|
+
rubygems_version: 3.0.0.beta1
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Groonga-log is a collection of library and tools to process [Groonga](http://groonga.org/)'s
|