Log when an error happens on cleanup
The restart module needs os and sys