Logging fixes

This new PR just replaces importing pyfits with astropy.