lib/teamster-cli.rb in teamster-0.6.0 vs lib/teamster-cli.rb in teamster-0.6.1
- old
+ new
@@ -158,10 +158,18 @@
def config_ru
<<-CODE
require 'teamster'
Dir.glob("lib/*.rb").each {|file| require File.absolute_path(file)}
+
+Dir.mkdir("log") unless Dir.exists?("log")
+log_file = File.new("log/teamster-#{Time.now.strftime("%Y%m%d-%H%M")}.log", "a+")
+$stdout.reopen(log_file)
+$stderr.reopen(log_file)
+$stdout.sync=true
+$stderr.sync=true
+
run Teamster::Core::App
CODE
end
def teamster_adapters
@@ -190,9 +198,14 @@
views_at \"\#\{File.dirname(__FILE__)\}/#{name}/views\"
under_development \# Remove this line when development is finished.
\# Register this class so it can be used.
register self
+
+ configure do
+ enable :logging \# To log, use \"logger.info <MSG>\". Log messages are captured
+ \# in the file specified in config.ru.
+ end
get '/#{name}/?' do
erb :#{name}
end
end