logtool 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/logtool/block.rb +5 -0
- data/lib/logtool/parser.rb +6 -0
- data/logtool.gemspec +1 -1
- metadata +3 -3
data/lib/logtool/block.rb
CHANGED
@@ -23,6 +23,11 @@ module LogTool
|
|
23
23
|
/^Started (GET|POST|PUT|DELETE) ".+?" for (\d\d?\d?.\d\d?\d?.\d\d?\d?.\d\d?\d?) at .*$/
|
24
24
|
end
|
25
25
|
|
26
|
+
def self.head_2_3 # old rails head
|
27
|
+
#$1 = IP, $2 = method
|
28
|
+
/^Processing .+? \(for (\d\d?\d?.\d\d?\d?.\d\d?\d?.\d\d?\d?) at .*?(GET|POST|PUT|DELETE).*$/
|
29
|
+
end
|
30
|
+
|
26
31
|
def self.tail
|
27
32
|
# $1 = response
|
28
33
|
time = /\d+(ms|s)/
|
data/lib/logtool/parser.rb
CHANGED
@@ -24,6 +24,12 @@ module LogTool
|
|
24
24
|
block.method = $1
|
25
25
|
block.ip = $2
|
26
26
|
block.text = line + "\n"
|
27
|
+
elsif line =~ Block.head_2_3
|
28
|
+
blocks << block if block
|
29
|
+
block = Block.new
|
30
|
+
block.method = $2
|
31
|
+
block.ip = $1
|
32
|
+
block.text = line + "\n"
|
27
33
|
elsif block and line =~ Block.tail
|
28
34
|
block.response = $1
|
29
35
|
block.time = $2
|
data/logtool.gemspec
CHANGED
metadata
CHANGED