always use the tempfile module for temporary directories
added a logname option to better control how messages are logged