[Groonga-commit] droonga/droonga-engine at c97f2fa [master] droonga-engine: don't change log level env in Configuration

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 5 13:22:43 JST 2015


Kouhei Sutou	2015-01-05 13:22:43 +0900 (Mon, 05 Jan 2015)

  New Revision: c97f2fa0db84caa2f079720e5f593fe21b113103
  https://github.com/droonga/droonga-engine/commit/c97f2fa0db84caa2f079720e5f593fe21b113103

  Message:
    droonga-engine: don't change log level env in Configuration
    
    It's not the work of Configuration.

  Modified files:
    lib/droonga/command/droonga_engine.rb

  Modified: lib/droonga/command/droonga_engine.rb (+8 -6)
===================================================================
--- lib/droonga/command/droonga_engine.rb    2015-01-05 13:18:37 +0900 (4a67e80)
+++ lib/droonga/command/droonga_engine.rb    2015-01-05 13:22:43 +0900 (6e0e2dd)
@@ -48,6 +48,7 @@ module Droonga
         parse_command_line_arguments!(command_line_arguments)
 
         setup_path
+        setup_log
 
         if****@confi*****?
           Process.daemon
@@ -80,6 +81,10 @@ module Droonga
         end
       end
 
+      def setup_log
+        ENV["DROONGA_LOG_LEVEL"] =****@confi*****_level
+      end
+
       def run_main_loop
         main_loop = MainLoop.new(@configuration)
         main_loop.run
@@ -121,6 +126,7 @@ module Droonga
           @port = nil
           @tag  = nil
 
+          @log_level       = nil
           @log_file        = nil
           @daemon          = nil
           @pid_file_path   = nil
@@ -149,11 +155,7 @@ module Droonga
         end
 
         def log_level
-          ENV["DROONGA_LOG_LEVEL"] || config["log_level"] || default_log_level
-        end
-
-        def log_level=(level)
-          ENV["DROONGA_LOG_LEVEL"] = level
+          @log_level || config["log_level"] || default_log_level
         end
 
         def log_file_path
@@ -272,7 +274,7 @@ module Droonga
                     "The log level of the Droonga engine",
                     "[#{levels_label}]",
                     "(#{default_log_level})") do |level|
-            self.log_level = level
+            @log_level = level
           end
           parser.on("--log-file=FILE",
                     "Output logs to FILE",
-------------- next part --------------
HTML����������������������������...
Download 



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