If log_filename is NULL or stdout, return stdout, otherwise try to open log_filename as a filename. If successful, return file handle, otherwise stdout
| 593 | // If log_filename is NULL or stdout, return stdout, otherwise try to open log_filename |
| 594 | // as a filename. If successful, return file handle, otherwise stdout |
| 595 | FILE* GetLayerLogOutput(const char* log_filename, std::vector<std::string>& setting_warnings) { |
| 596 | FILE* log_output = NULL; |
| 597 | if (!log_filename || !strcmp("stdout", log_filename)) { |
| 598 | log_output = stdout; |
| 599 | } else { |
| 600 | log_output = fopen(log_filename, "w"); |
| 601 | if (log_output == NULL) { |
| 602 | if (log_filename) { |
| 603 | setting_warnings.emplace_back("log_filename (" + std::string(log_filename) + |
| 604 | ") could not be opened, falling back to stdout instead."); |
| 605 | } |
| 606 | log_output = stdout; |
| 607 | } |
| 608 | } |
| 609 | return log_output; |
| 610 | } |
| 611 | |
| 612 | // Definitions for Debug Actions |
| 613 | enum VkLayerDbgActionBits { |
no test coverage detected