rack-ougai 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: adb387b366736cd48de82f722cdc796dc130bad9c2f715dd538686e1af138588
4
- data.tar.gz: b945f7a876afb625a667e322773c22340fe241da24dcc552cbdf545424e33f5a
3
+ metadata.gz: 32569974618926a8e710c12db76128de7e637a87c5c3db9e336250b3d97b4827
4
+ data.tar.gz: 2b873a2507f65c3912483d3533321559a381c2fe08b6c542180af62bd0a778a7
5
5
  SHA512:
6
- metadata.gz: b27ac0c007b2a9df35249cf6eb0de61beff16cb836a63a2ec5c872b86b2b587ad4e2a3846d4f1139135647e60590d902873e5486c44d8e5450d298e3394e7e9a
7
- data.tar.gz: f626b4ed807cf52005d534e5563bf974d69d45b977fd0f9ea5cf9b930df1c207e3264ba58e7186a9e7009339b945afbb29c5f32a6a2da83e906daff3349064df
6
+ metadata.gz: 6e5eb9e23f07498a76024a25dbabedec3410cb07cb2632521e53df368ef18cb65509b62f56f3f45337703c32b36144af5e40b42c47c9fd700fe9a51a19ed2b1e
7
+ data.tar.gz: 0c5403cd1971d3ddcc70580f7e54e072b319ee3f8cd4ac28768a1ca4e001afc9dd3a9acc6e6fc3a0de909617a9c7fe01d201295ec5257271dcb4b2479def7ff6
@@ -3,9 +3,10 @@ require 'time'
3
3
  module Rack
4
4
  module Ougai
5
5
  class LogRequests
6
- def initialize(app, logger = nil)
6
+ def initialize(app, logger = nil, local: false)
7
7
  @app = app
8
8
  @logger = logger
9
+ @local = local
9
10
  end
10
11
 
11
12
  def call(env)
@@ -22,7 +23,7 @@ module Rack
22
23
  end_time = Time.now
23
24
 
24
25
  ret = {
25
- time: start_time,
26
+ time: @local ? start_time : start_time.utc,
26
27
  usec: end_time.usec - start_time.usec,
27
28
  remote_addr: env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"],
28
29
  method: env[REQUEST_METHOD],
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module Ougai
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-ougai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshimitsu Takahashi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-01-25 00:00:00.000000000 Z
12
+ date: 2018-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler