Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
add loglevel option
Browse files Browse the repository at this point in the history
  • Loading branch information
quark-zju committed Oct 20, 2012
1 parent ff5b533 commit 39c96a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/rrails
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ opts.on('-p', '--port=i', 'Set server port. Default: decided by rails_env.') {|v
opts.on('--[no-]ondemand', "(Client) Start RRails server on demand. Default: #{options[:ondemand]}.") {|v| options[:ondemand] = v}
opts.on('-t', '--[no-]pty', "(Client) Prepare a PTY. Default: decided by commands.") {|v| options[:pty] = v }
opts.on('--logfile=s', '(Server) Set log file path. Default: (stderr).') {|v| options[:logfile] = v}
opts.on('--loglevel=i', '(Server) Set log level (0 to 3). Default: 0.') {|v| options[:loglevel] = v}
opts.on('--pidfile=s', '(Server) Set RRails server pidfile file.') {|v| options[:pidfile] = v}
opts.on('-b', '--[no-]background', '(Server) Run in background.') {|v| options[:background] = v}

Expand Down
1 change: 1 addition & 0 deletions lib/rrails/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def initialize(options={})
end
@app_path = File.expand_path('./config/application')
@logger = Logger.new(options[:logfile] ? options[:logfile] : (@background ? nil : STDERR))
@logger.level = options[:loglevel] || 0
end

def stop
Expand Down

0 comments on commit 39c96a8

Please sign in to comment.