Added logging system. Everything but the actual saving of log files is there