Correctly handle NULL PIDs
Moved std::cout output into logger class