diff options
author | Aaron Quint <aaron@quirkey.com> | 2008-12-27 23:29:48 -0500 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-28 16:49:19 +0000 |
commit | c0c79f779c990f9e53c9b600291801fdf0bbe56b (patch) | |
tree | a206415a03e419d9107c812293a5ca69abcdcb48 /railties | |
parent | 9fd35fc2d892393386ca9f522d25ba0bcb9c6764 (diff) | |
download | rails-c0c79f779c990f9e53c9b600291801fdf0bbe56b.tar.gz rails-c0c79f779c990f9e53c9b600291801fdf0bbe56b.tar.bz2 rails-c0c79f779c990f9e53c9b600291801fdf0bbe56b.zip |
Use SimpleLogger for Rails::TemplateRunner outside of the Generator context [#1618 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/template_runner.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/template_runner.rb b/railties/lib/rails_generator/generators/applications/app/template_runner.rb index 4af85762aa..7f2e086271 100644 --- a/railties/lib/rails_generator/generators/applications/app/template_runner.rb +++ b/railties/lib/rails_generator/generators/applications/app/template_runner.rb @@ -355,5 +355,15 @@ module Rails def logger @logger ||= Rails::Generator::Base.logger end + + def logger + @logger ||= if defined?(Rails::Generator::Base) + Rails::Generator::Base.logger + else + require 'rails_generator/simple_logger' + Rails::Generator::SimpleLogger.new(STDOUT) + end + end + end end
\ No newline at end of file |