]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4690 activerecord migrations should use SLF4J
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 20 Sep 2013 21:25:10 +0000 (23:25 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 20 Sep 2013 21:25:10 +0000 (23:25 +0200)
sonar-server/src/main/webapp/WEB-INF/config/environment.rb

index b62af0dbff50eb580cb3d46107a76562f08f6691..4afaf130e46d7e0a67fee3b8d39786ccb40bc632 100644 (file)
@@ -154,7 +154,6 @@ class ActiveRecord::Migration
         END;})
   end
 
-
   def self.drop_id_trigger(table)
       drop_trigger("#{table}_idt")
   end
@@ -163,6 +162,12 @@ class ActiveRecord::Migration
     execute_ddl("drop trigger #{trigger_name}", "DROP TRIGGER #{trigger_name}")
   end
 
+  def self.write(text="")
+    # See migration.rb, the method write directly calls "puts"
+    Java::OrgSlf4j::LoggerFactory::getLogger('DbMigration').info(text) if verbose
+  end
+
+
   private
 
   def self.execute_ddl(message, ddl)