• 0 Posts
  • 2 Comments
Joined 3 years ago
cake
Cake day: July 1st, 2023

help-circle
  • To add to the last comment, I’d also suggest not mixing logging and business code. That is to say that you should put the system call on its own line, so that it is clear that it’s not just a logging call:

      if (!strcmp(platform, "windows") && !isSpecificPlatform) {
        debugLog("Falling back to rm -rf", 2);
        int result = system(strfmt("rm -rf %s", path)); 
        debugLog(strfmt("rm -rf exited with code %d", result), 3);
      }
    

    It may just be a me problem, but I have a tendency to skim over the logging lines unless I’m intentionally reading code carefully, in which case the system call may get overlooked