| 39 | // Also prints to the log file if it is open (regardless of print_g). |
| 40 | |
| 41 | void lprintf(const char* format, ...) // args like printf |
| 42 | { |
| 43 | char s[SBIG]; |
| 44 | va_list args; |
| 45 | va_start(args, format); |
| 46 | VSPRINTF(s, format, args); |
| 47 | va_end(args); |
| 48 | if (print_g) |
| 49 | { |
| 50 | printf("%s", s); |
| 51 | fflush(stdout); // flush so if there is a crash we can see what happened |
| 52 | } |
| 53 | if (logfile_g) |
| 54 | { |
| 55 | // we don't check fputs here, to prevent recursive calls and msgs |
| 56 | fputs(s, logfile_g); |
| 57 | fflush(logfile_g); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // Like printf but prints to the log file only (and not to stdout). |
| 62 | // Used for detailed stuff that we don't usually want to see. |
no outgoing calls
no test coverage detected