The functions registerLog and doLog provide a simple mechanism to handle loggings (printing text messages to files or other types of connections) in R.
registerLog
doLog
Useful links