Add file logging and better handling of camera status when camera is sleeping