Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <web-client> use-activeresource : remove exception logger as now logger is configured to properly log exception
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Mon, 24 Aug 2009 15:37:54 +0200
  • Message-id: <E1MoJ2J-00038C-PB@xxxxxxxxxxxxxxxx>
ref: refs/heads/use-activeresource
commit 887e2eaa19441d2ea7b8712465098f3dab9bede4
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Tue Aug 18 16:58:04 2009 +0200

remove exception logger as now logger is configured to properly log
exception
---
.../app/controllers/systemtime_controller.rb | 10 +++++-----
webclient/lib/exception_logger.rb | 16 ----------------
webclient/lib/proxy_loader.rb | 8 +++-----
webclient/lib/yast/service_resource.rb | 2 +-
4 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/plugins/systemtime/app/controllers/systemtime_controller.rb
b/plugins/systemtime/app/controllers/systemtime_controller.rb
index 9c68f7a..a8f9747 100644
--- a/plugins/systemtime/app/controllers/systemtime_controller.rb
+++ b/plugins/systemtime/app/controllers/systemtime_controller.rb
@@ -70,7 +70,7 @@ class SystemtimeController < ApplicationController
fill_current_region
rescue Exception => e
flash[:warning] = e.message
- ExceptionLogger.log_exception e
+ logger.warn e
redirect_to root_path
end
end
@@ -96,10 +96,10 @@ class SystemtimeController < ApplicationController
flash[:notice] = _('Settings have been written.')
rescue ActiveResource::ClientError => e
flash[:error] = YaST::ServiceResource.error(e)
- ExceptionLogger.log_exception e
+ logger.warn e
rescue Exception => e
flash[:error] = e.message
- ExceptionLogger.log_exception e
+ logger.warn e
end

redirect_to :action => :index
@@ -121,10 +121,10 @@ class SystemtimeController < ApplicationController
flash[:notice] = _('Settings have been written.')
rescue ActiveResource::ClientError => e
flash[:error] = YaST::ServiceResource.error(e)
- ExceptionLogger.log_exception e
+ logger.warn e
rescue Exception => e
flash[:error] = e.message
- ExceptionLogger.log_exception e
+ logger.warn e
end

redirect_to :action => :index
diff --git a/webclient/lib/exception_logger.rb
b/webclient/lib/exception_logger.rb
deleted file mode 100644
index 3011698..0000000
--- a/webclient/lib/exception_logger.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# = ExceptionLogger module
-# Provides unified way to log exception in application.
-# == Usage
-# Just add log_exception method with Exception as argument and it write
informations
-# to log
-#
-# rescue Exception => e
-# ExceptionLogger.log_exception e
-
-
-class ExceptionLogger
- def ExceptionLogger.log_exception e
- Rails.logger.warn e.message
- Rails.logger.info e.backtrace.join("\n")
- end
-end
diff --git a/webclient/lib/proxy_loader.rb b/webclient/lib/proxy_loader.rb
index 4e94aae..f6a95c6 100644
--- a/webclient/lib/proxy_loader.rb
+++ b/webclient/lib/proxy_loader.rb
@@ -1,8 +1,6 @@
# = ProxyLoader module
# Modules handles finding and loading proxy. It take care about pottential
# problems and redirect in problems to correct page.
-# == requirements
-# Use ExceptionLogger module to it run. Intended to be used in Controller.
# == Usage
# Include module in controller and use method load_proxy.
#
@@ -49,7 +47,7 @@ module ProxyLoader
begin
@permissions = proxy.permissions
rescue Exception => e
- ExceptionLogger.log_exception e
+ Rails.logger.warn e
redirect_to "/bad_permissions"
return nil
end
@@ -63,11 +61,11 @@ module ProxyLoader
end
rescue ActiveResource::ClientError => e
flash[:error] = YaST::ServiceResource.error(e)
- ExceptionLogger.log_exception e
+ Rails.logger.warn e
redirect_to root_path
rescue Exception => e
flash[:error] = e.message
- ExceptionLogger.log_exception e
+ Rails.logger.warn e
redirect_to root_path
end

diff --git a/webclient/lib/yast/service_resource.rb
b/webclient/lib/yast/service_resource.rb
index 6bfc072..1076866 100644
--- a/webclient/lib/yast/service_resource.rb
+++ b/webclient/lib/yast/service_resource.rb
@@ -69,7 +69,7 @@ module YaST
resource = self.resource_for_interface(interface_name)
raise "null resource, should throw inside resource_for_interface"
unless resource
rescue Exception => e
- ExceptionLogger::log_exception e
+ Rails.logger.warn e
return nil
end

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages