opi 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/opi/api.rb +6 -1
  3. data/lib/opi/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea0955bb0306d56fd067a64f3f8739d8b9dce113
4
- data.tar.gz: ba25fe211021b1c982b2eb2be5c187cfb09cc66b
3
+ metadata.gz: 574af283fb9fd743e2dee26fbc63e4a75bb4819c
4
+ data.tar.gz: d188146b704c8252f20d036828a6ddb2342790a0
5
5
  SHA512:
6
- metadata.gz: cacb4261a84ead0ee8b6a902e0d24a2ddd551e0d12ad687d0b22ce48583d743f8d229ea109755c0e53dc43f097efc98319a44e0b8068de710464ab5501b161ff
7
- data.tar.gz: 83a3e45cb00fcba3f62c709acdf0ddb5a6853c97f033dd052c76a1c5191e2aa64ed28efed75e067f3a3655d64b66f95220ed18c608d07e1675004b81aaa45bfa
6
+ metadata.gz: c884ccc671827468d88ba6a6192bce7b10447d674ac9f581944c1530e208a7fb28785a5dc0bf8e7ce0c1573339bcf0d3d5f747b5014e6fee6287058c467742ba
7
+ data.tar.gz: 7dff41c84726bfbf38fca7d538ea34cd2ccdf1db693004f8f41b6ff4b29636b23df91a2c1601c1d51cd9bc4319d8b661671c6a8b9bb66c7bb9538e02bd9f602f
@@ -57,7 +57,7 @@ module Opi
57
57
  def initialize(options={})
58
58
  puts "* Opi Version: #{Opi::VERSION} initializing".green
59
59
  @logger = options[:logger] || Logger.new(STDOUT)
60
- @logger.level = options[:debug] ? Logger::DEBUG : Logger::WARN
60
+ @logger.level = options[:debug] ? Logger::DEBUG : Logger::INFO
61
61
  end
62
62
 
63
63
  def call(env)
@@ -73,6 +73,10 @@ module Opi
73
73
  request.params.merge!(params) if params and params.is_a? Hash
74
74
  request.params.merge!('splat' => params.join(',')) if params and params.is_a? Array
75
75
 
76
+ start_time = Time.now
77
+ logger.info " Started #{request.method} \"#{request.path}\" for #{request.ip} at #{start_time.to_s(:short)}"
78
+ logger.info " Parameters: #{request.params}"
79
+
76
80
  if route
77
81
  logger.debug "#{request.method} #{request.path} => route #{route.inspect}".green
78
82
  context = Context.new(env, route, request, response, self.class.before_filters, self.class.after_filters)
@@ -86,6 +90,7 @@ module Opi
86
90
  response.internal_server_error!(e)
87
91
  end
88
92
 
93
+ logger.info " Completed #{response.status} in #{((Time.now - start_time)*1000).round(2)}ms"
89
94
  [response.status, response.header, response.body]
90
95
  end
91
96
 
@@ -1,3 +1,3 @@
1
1
  module Opi
2
- VERSION = "0.3.10"
2
+ VERSION = "0.3.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor