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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 700f207342cb18c6c91bc2d665a7090768a3755b
4
- data.tar.gz: 789d488c8fd51697e4dcd90b6d22c7ca7d208bed
3
+ metadata.gz: 8fee50d48cdeb29af05914d7608be70f7acaea7f
4
+ data.tar.gz: 548e79acb8ba02be609ec3f15c70551440a50f1f
5
5
  SHA512:
6
- metadata.gz: c01c03fbd15981e2e390adf72dc96a3e54f8a45eb204776c8fe67bf3c5caa8e3a81ac974cb74cdcf2e5534a8015bdfd4b9aaf30e2a5792afc4c632d01e81501f
7
- data.tar.gz: fe4222b708c1c28331283a6bb931f4e76034698423521eee85046cef553612953cb7ffc35bf14373a394bdd002d52de0ee456ad283d5e0bb0d86839ce5307b53
6
+ metadata.gz: 352af42d969b0fa273d4ee5ac6a8e8a112f5475e7532fd0064500df67ab605ebc10bffcf2e38ee39063bb4cb17848fa1642831eed865456b0bfc91ac0a833b68
7
+ data.tar.gz: fbe88ac1506fcf74aaa4b6713aa657bdba3c4800528ed029f9ecf2fc69eb94e2b26b17f8e5cdc2e9d30c5937ae6c71e5b02ea3b8d671f21805136efd1ddd93fc
@@ -1,3 +1,3 @@
1
1
  module LogParser
2
- VERSION = '1.2.1'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
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
- LINE_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
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 || 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: 1.2.1
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: 2014-11-20 00:00:00.000000000 Z
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.2.2
82
+ rubygems_version: 2.4.3
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Easily search log files