Navigation Menu

Skip to content

Commit

Permalink
droonga-engine: don't use log file by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 5, 2015
1 parent 9446d3c commit df3e4f3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/droonga/command/droonga_engine.rb
Expand Up @@ -214,15 +214,19 @@ def default_log_level
end

def default_log_file_path
Path.default_log_file
nil
end

def default_pid_file_path
nil
end

def expand_path(path)
Pathname.new(path).expand_path
def normalize_path(path)
if path == "-"
nil
else
Pathname.new(path).expand_path
end
end

def config
Expand Down Expand Up @@ -282,7 +286,7 @@ def add_log_options(parser)
parser.on("--log-file=FILE",
"Output logs to FILE",
"(#{default_log_file_path})") do |path|
@log_file_path = expand_path(path)
@log_file_path = normalize_path(path)
end
end

Expand All @@ -299,7 +303,7 @@ def add_process_options(parser)
end
parser.on("--pid-file=PATH",
"Put PID to PATH") do |path|
@pid_file_path = expand_path(path)
@pid_file_path = normalize_path(path)
end
end

Expand Down

0 comments on commit df3e4f3

Please sign in to comment.