change logger to singleton pattern with static functions
change singleton pattern
add deconstructor to close writer in logger