For larger projects, tracing is vital. Smaller projects can get away with printing to stderr for debugging or stepping through statements. Larger projects need to have tracing in place before debugging. When debugging, you turn on the tracing. When you deploy the application, you turn off the tracing. In Resin, logging is just another stream, similar to the familiar print writer. It's enabled by the configuration file. Using the following idiom adds tracing with essentially no performance penalty.
When you run this, nothing will get logged until the configuration file enables '/foo.com/test'. You could also enable '/foo.com' to get all logging from foo.com. Here's the configuration file for logging to a log file in log/foo.log.
can be any VFS path known to Resin. 'stderr:' will log to the standard error.
|