Refactored logging.cpp, added some additional checks in serial.cpp