Skip to content

Commit

Permalink
Updated FAQ on logging
Browse files Browse the repository at this point in the history
  • Loading branch information
David James committed Jul 25, 2008
1 parent 81ae013 commit 77736bc
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,19 @@ back. If you want to just execute something against the database, use

=== Can I get an query log of what DataMapper is issuing?

Yup, to set this up, do:
An example of how to modify an existing logger:

DataMapper::Logger.new(STDOUT, 0)
DataMapper.logger.set_log(STDOUT, :debug)

Incidentally, if you'd like to send a message into the DataMapper logger, do:
An example of how to create new logger:

DataMapper::Logger.new(STDOUT, :info)

To send a message to the DataMapper logger:

DataMapper.logger.debug("something")
DataMapper.logger.info ("something")
DataMapper.logger.warn ("something")
DataMapper.logger.error("something")
DataMapper.logger.fatal("something")

DataMapper.logger.debug { "something" }
DataMapper.logger.info { "something" }
DataMapper.logger.warn { "something" }
DataMapper.logger.error { "something" }
DataMapper.logger.fatal { "something" }

0 comments on commit 77736bc

Please sign in to comment.