semantic_logger 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -134,15 +134,16 @@ module SemanticLogger
134
134
  start = Time.now
135
135
  begin
136
136
  result = yield
137
+ end_time = Time.now
137
138
  # Add scoped payload
138
139
  if self.payload
139
140
  payload = payload.nil? ? self.payload : self.payload.merge(payload)
140
141
  end
141
- self.class.queue << Log.new(:#{level}, self.class.thread_name, name, message, payload, start, 1000.0 * (Time.now - start), tags)
142
+ self.class.queue << Log.new(:#{level}, self.class.thread_name, name, message, payload, end_time, 1000.0 * (end_time - start), tags)
142
143
  result
143
144
  rescue Exception => exc
144
145
  # TODO Need to be able to have both an exception and a Payload
145
- self.class.queue << Log.new(:#{level}, self.class.thread_name, name, message, exc, start, 1000.0 * (Time.now - start), tags)
146
+ self.class.queue << Log.new(:#{level}, self.class.thread_name, name, message, exc, Time.now, 1000.0 * (Time.now - start), tags)
146
147
  raise exc
147
148
  end
148
149
  else
@@ -1,3 +1,3 @@
1
1
  module SemanticLogger #:nodoc
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/test/logger_test.rb CHANGED
@@ -62,7 +62,7 @@ class LoggerTest < Test::Unit::TestCase
62
62
  @logger.with_payload(:more => 'data', :even => 2) do
63
63
  @logger.info('Hello world')
64
64
  SemanticLogger::Logger.flush
65
- assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ \w \[\d+:.+\] LoggerTest -- Hello world -- \{:more=>\"data\", :even=>2, :tracking_number=>\"123456\"\}/, @mock_logger.message
65
+ assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ \w \[\d+:.+\] LoggerTest -- Hello world -- \{:even=>2, :more=>\"data\", :tracking_number=>\"123456\"\}/, @mock_logger.message
66
66
  end
67
67
  end
68
68
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 1
9
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Reid Morrison