You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/02/18 10:54:31 UTC
[1/6] git commit: CIMI: If API_VERBOSE is enabled,
log into Deltacloud logger
CIMI: If API_VERBOSE is enabled, log into Deltacloud logger
This patch will make sure that logs produced by Sequel (SQL logs)
will go to DeltacloudLogger instead of default Ruby Logger.
The reason is that user can set the '-L/--log' option and redirect
all logs into a file. In that case, this patch will make sure
that SQL logs are saved into that file as well.
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/9320dcee
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/9320dcee
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/9320dcee
Branch: refs/heads/master
Commit: 9320dcee382df5a2eb8d243ff9db42ab0ca323e0
Parents: 3edda82
Author: Michal Fojtik <mf...@redhat.com>
Authored: Fri Feb 15 11:15:50 2013 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Mon Feb 18 09:58:02 2013 +0100
----------------------------------------------------------------------
server/lib/db.rb | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9320dcee/server/lib/db.rb
----------------------------------------------------------------------
diff --git a/server/lib/db.rb b/server/lib/db.rb
index 9bf7ead..5615f50 100644
--- a/server/lib/db.rb
+++ b/server/lib/db.rb
@@ -17,7 +17,13 @@ module Deltacloud
def self.database(opts={})
- opts[:logger] = ::Logger.new($stdout) if ENV['API_VERBOSE']
+ if ENV['API_VERBOSE']
+ if Deltacloud.respond_to? :config
+ opts[:logger] = Deltacloud.config[:cimi].logger
+ else
+ opts[:logger] = ::Logger.new($stdout)
+ end
+ end
@db ||= Sequel.connect(DATABASE_LOCATION, opts)
end