Separated Log Farmatting and Log Writing into separate modules