UBCSailbot / raye-global-pathfinding

UBC Sailbot's Global Pathfinding Repository: A* pathfinding that creates sailing paths with minimized length and desirable wind speeds throughout.
MIT License
5 stars 1 forks source link

NEW MEMBER TASK: Add prints for reading files #61

Open tylerlum opened 2 years ago

tylerlum commented 2 years ago

It is very frustrating when things fail silently or fail without knowing why. Sometimes we just see: segfault

To resolve this, in key areas, we need to add prints before and after. A common failure is reading files if they are missing or have invalid contents. It would be nice to have something like: About to read <file> then right after it is done: Finished reading <file>.

If we don't have the finished line and it fails later, we may think the reading was the failure, even if it read fine and failed on a future step.

The biggest usage is in: readCsv() function here: https://github.com/UBCSailbot/global-pathfinding/blob/master/src/grib/gribParse.cpp#L30 https://github.com/UBCSailbot/global-pathfinding/blob/master/src/grib/gribParse.cpp#L340

Should add something like std::cout << "About to read from " << csvfilename << std::endl; at the beginning and end, maybe removing some other prints.