You should use the function dd() to log something during cron.
Here is the doc: https://api.drupal.org/api/devel/devel.module/function/dd/7
It will log the output to a file, which later you can investigate. I think you must have private file path set.
you could use something like this, But be careful about XSS!
$export = var_export($var, TRUE) // TRUE will cause var_export to return the output not print it.
$export = nl2br($export); // Convert new lines to <br> tag for display in HTML
$export = strreplace(' ', ' '); // Again convert whitespace to HTML specific chatacter
watchdog('my_debug', $export); // That's it!
or even easier:
but again be careful about CSSF and XSS
watchdog('my_debug', '<pre>' . var_export($variable) . '</pre>');
dd is the safe drupal way to go.
From comments so you wont miss:
... better than dd() is ddl(), from the drupal_debug_log module that enhances > the devel module... – DrCord
Important point to developers.
If you search drupal.org modules there are many more to make development easier. After you found and used them, it would sound impossible to go without them (devel_themer to name one). An example search.