lib/capcode/base/dm.rb in capcode-base-datamapper-0.2.0 vs lib/capcode/base/dm.rb in capcode-base-datamapper-0.3.0
- old
+ new
@@ -24,10 +24,12 @@
end
class << self
def db_connect( dbfile, logfile ) #:nodoc:
dbconfig = YAML::load(File.open(dbfile)).keys_to_sym
- DataMapper::Logger.new(logfile, :debug)
+ loglevel = (dbconfig.delete(:loglevel) || "error").to_sym
+ DataMapper.finalize
+ DataMapper::Logger.new(logfile, loglevel)
DataMapper.setup(:default, dbconfig)
DataMapper.auto_upgrade!
end
end
end
\ No newline at end of file