log_parser 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/log_parser/version.rb +1 -1
- data/lib/log_parser.rb +14 -7
- 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: 8fee50d48cdeb29af05914d7608be70f7acaea7f
|
4
|
+
data.tar.gz: 548e79acb8ba02be609ec3f15c70551440a50f1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 352af42d969b0fa273d4ee5ac6a8e8a112f5475e7532fd0064500df67ab605ebc10bffcf2e38ee39063bb4cb17848fa1642831eed865456b0bfc91ac0a833b68
|
7
|
+
data.tar.gz: fbe88ac1506fcf74aaa4b6713aa657bdba3c4800528ed029f9ecf2fc69eb94e2b26b17f8e5cdc2e9d30c5937ae6c71e5b02ea3b8d671f21805136efd1ddd93fc
|
data/lib/log_parser/version.rb
CHANGED
data/lib/log_parser.rb
CHANGED
@@ -9,12 +9,19 @@ require 'log_parser/client'
|
|
9
9
|
module LogParser
|
10
10
|
extend self
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
UNICORN_PATTERN = %r{
|
13
|
+
\[(\d+-\d+-\d+T\d+:\d+:\d+-\d+:\d+)\] # timestamp
|
14
|
+
(\s(\w+):)? # type of message (ERROR, WARNING, INFO)
|
15
|
+
(\s\[(.+)\])? # prefix (introduced by log.rb)
|
16
|
+
\s(.+)$ # message body
|
17
|
+
}x
|
18
|
+
|
19
|
+
LOGGER_PATTERN = %r{
|
20
|
+
\w,\s\[(\d+-\d+-\d+T\d+:\d+:\d+\.\d+)\s#\d+\] # timestamp
|
21
|
+
(\s+(\w+)\s--)? # type of message (ERROR, WARNING, INFO)
|
22
|
+
(\s(.+):\s)? # prefix (shared context for multiple lines)
|
23
|
+
(.+)$ # message body
|
24
|
+
}x
|
18
25
|
|
19
26
|
def path_for(file)
|
20
27
|
Pathname.new(File.join(Dir.pwd, 'log', file))
|
@@ -33,6 +40,6 @@ module LogParser
|
|
33
40
|
end
|
34
41
|
|
35
42
|
def line_pattern
|
36
|
-
config.line_pattern ||
|
43
|
+
config.line_pattern || UNICORN_PATTERN
|
37
44
|
end
|
38
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.4.3
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Easily search log files
|