implemented logging even when no file is being saved. It still needs some reworking.