How to debug / log comments when developing a custom module to fire when cron is run
The function watchdog is also available in Drupal 7

Here is an exemple of how you can use it in your case :

watchdog('MyModule', 'My message, this is my node title : %node_title', array('%node_title' =&gt; $node-&gt;title), WATCHDOG_INFO, NULL);


If you want to use a translated string you can do something like this :

watchdog('MyModule', t('My message, this is my node title : @node_title', array('@node_title' =&gt; $node-&gt;title)), array(), WATCHDOG_INFO, NULL);


If you need to print an array, you can try something like this :

watchdog('MyModule', '&lt;pre&gt;'. print_r($node, TRUE) .'&lt;/pre&gt;', array(), WATCHDOG_INFO, NULL);


You can watch the log in Reports -> Recent log messages (admin/reports/dblog) if the core module "Database logging" is activated.

Once your module is stable, you can remove the watchdog line.