[Groonga-commit] droonga/fluent-plugin-droonga at ca095cc [master] Better log output formatting on error

Back to archive index

Yoji Shidara null+****@clear*****
Wed Dec 25 19:35:29 JST 2013


Yoji Shidara	2013-12-25 19:35:29 +0900 (Wed, 25 Dec 2013)

  New Revision: ca095cc39e85553176b93267a632cde6818e8b4a
  https://github.com/droonga/fluent-plugin-droonga/commit/ca095cc39e85553176b93267a632cde6818e8b4a

  Message:
    Better log output formatting on error

  Modified files:
    lib/droonga/logger.rb
    lib/droonga/plugin.rb

  Modified: lib/droonga/logger.rb (+4 -3)
===================================================================
--- lib/droonga/logger.rb    2013-12-25 19:12:38 +0900 (d529268)
+++ lib/droonga/logger.rb    2013-12-25 19:35:29 +0900 (7f65d71)
@@ -24,10 +24,11 @@ module Droonga
       end
     end
 
-    def error(message, additional_information={})
+    def error(message, exception, additional_information={})
       if $log
-        $log.error(message, additional_information)
-        $log.error_backtrace
+        $log.error("#{message} #{exception.message}(#{exception.class})",
+          additional_information)
+        $log.error_backtrace(exception.backtrace)
       end
     end
   end

  Modified: lib/droonga/plugin.rb (+2 -3)
===================================================================
--- lib/droonga/plugin.rb    2013-12-25 19:12:38 +0900 (c589bf4)
+++ lib/droonga/plugin.rb    2013-12-25 19:35:29 +0900 (0745e5f)
@@ -36,9 +36,8 @@ module Droonga
       __send__(self.class.method_name(command), *arguments)
     rescue => exception
       Logger.error("error while processing #{command}",
-                   arguments: arguments,
-                   exception: exception,
-                   backtrace: exception.backtrace)
+                   exception,
+                   arguments: arguments)
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index