Commit 3efdef0f authored by John E. Vincent's avatar John E. Vincent

adding logging options and fixing the redis url mess

parent 91ffd042
...@@ -27,6 +27,8 @@ require 'json' ...@@ -27,6 +27,8 @@ require 'json'
opts = Slop.parse do opts = Slop.parse do
banner "Usage: noah-watcher.rb [options]" banner "Usage: noah-watcher.rb [options]"
on :r, :redis_url, 'Redis URL to use. This MUST match what the Noah server is using for now', :default => 'redis://localhost:6379/0', :argument => true
on :o, :output, 'Log destination - full file path. Default is STDOUT', :default => STDOUT, :argument => true
on '--depinstall', "Installs additional dependencies" do on '--depinstall', "Installs additional dependencies" do
puts "Installing dependencies" puts "Installing dependencies"
puts "em-hiredis..." puts "em-hiredis..."
...@@ -54,6 +56,8 @@ rescue LoadError => e ...@@ -54,6 +56,8 @@ rescue LoadError => e
exit exit
end end
ENV['REDIS_URL'] = opts[:redis_url]
begin begin
require 'noah' require 'noah'
require 'noah/agent' require 'noah/agent'
...@@ -62,7 +66,7 @@ rescue Errno::ECONNREFUSED ...@@ -62,7 +66,7 @@ rescue Errno::ECONNREFUSED
exit exit
end end
Noah::Log.logger = Logger.new(STDOUT) Noah::Log.logger = Logger.new(opts[:output])
LOGGER = Noah::Log.logger LOGGER = Noah::Log.logger
LOGGER.progname = __FILE__ LOGGER.progname = __FILE__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment