It is possible to add custom messages to the Rails log through in a single line command. The RAILS_DEFAULT_LOGGER object, which is defined in environment.rb, makes this possible.
The RAILS_DEFAULT_LOGGER object supports the following log levels:
* debug
* info
* warn
* error
* fatal
To add debug calls to your code for development mode just add the following:
RAILS_DEFAULT_LOGGER.info "Your log message"
0 reacties:
Een reactie plaatsen