how can setup DataObjects logger in way that I wheneer I switch from
on database (mysql, sqlite, postgres, etc) to another, i.e. change the
config/database.yml without the need to setup the right logger as
well.

the code I am using for this is kind of ugly and whenever a new
adapter comes out I need to release a new gem to have the available in
my applications:
    if DataObjects.const_defined?("Sqlite3")
      DataObjects::Sqlite3.logger = logger([appender,rails_appender],
DataObjects)
    elsif DataObjects.const_defined?("Mysql")
      DataObjects::Mysql.logger = logger([appender,rails_appender],
DataObjects)
    elsif DataObjects.const_defined?("Postgres")
      DataObjects::Postgres.logger = logger([appender,rails_appender],
DataObjects)
    end

I remember there was a time when datamapper just set the logger for
dataobjects. maybe there is a simple to achieve this.

regards Kristian

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to