Python can print logs in a file, but that is not the behavior you get out of the box. By default, it prints logs with a log level equal or higher than WARNING on stderr:
import logging
logging.debug('debug')
logging.info('info')
logging.warning('warning')
logging.error('error')
logging.critical('critical')
Here is what happens when you run this script:
$ python log.py
WARNING:root:warning
ERROR:root:error
CRITICAL:root:critical
$ python log.py 2>/dev/null # does not print anything
$
So if you redirected stderr to a file in your cron job, you should at least see the warnings and errors in that file. If you want to easily log directly into a file, you can use logging.basicConfig:
import logging
# print log in example.log instead of the console, and set the log level to DEBUG (by default, it is set to WARNING)
logging.basicConfig(filename='example.log', filemode='w', level=logging.DEBUG)
logging.debug('debug')
logging.info('info')
logging.warning('warning')
logging.error('error')
logging.critical('critical')
Now if you run it, you should not have any input in the console anymore, but everything should be in example.log:
$ python log.py
$ cat example.log
DEBUG:root:debug
INFO:root:info
WARNING:root:warning
ERROR:root:error
CRITICAL:root:critical
You'll find much more details and configuration options in the logging HOWTO page