@@ -802,7 +802,7 @@ VulkanExampleBase::VulkanExampleBase()
802802 // Command line arguments
803803 commandLineParser.add (" help" , { " --help" }, 0 , " Show help" );
804804 commandLineParser.add (" validation" , { " -v" , " --validation" }, 0 , " Enable validation layers" );
805- commandLineParser.add (" validationlog " , { " -vl" , " --validationlog " }, 0 , " Log validation messages to a textfile (validation.txt) " );
805+ commandLineParser.add (" validationlogfile " , { " -vl" , " --validationlogfile " }, 0 , " Log validation messages to a textfile" );
806806 commandLineParser.add (" vsync" , { " -vs" , " --vsync" }, 0 , " Enable V-Sync" );
807807 commandLineParser.add (" fullscreen" , { " -f" , " --fullscreen" }, 0 , " Start in fullscreen mode" );
808808 commandLineParser.add (" width" , { " -w" , " --width" }, 1 , " Set window width" );
@@ -831,12 +831,8 @@ VulkanExampleBase::VulkanExampleBase()
831831 if (commandLineParser.isSet (" validation" )) {
832832 settings.validation = true ;
833833 }
834- if (commandLineParser.isSet (" validationlog " )) {
834+ if (commandLineParser.isSet (" validationlogfile " )) {
835835 vks::debug::logToFile = true ;
836- std::ofstream logfile;
837- logfile.open (" validation.txt" , std::ios_base::app);
838- logfile << std::endl << " Sample: " << name << std::endl;
839- logfile.close ();
840836 }
841837 if (commandLineParser.isSet (" vsync" )) {
842838 settings.vsync = true ;
@@ -1034,6 +1030,11 @@ bool VulkanExampleBase::initVulkan()
10341030 this ->settings .validation = true ;
10351031#endif
10361032
1033+ // Validation messages can be stored, e.g. to be used in external tools like CI/CD
1034+ if (commandLineParser.isSet (" validationlogfile" )) {
1035+ vks::debug::log (" Sample: " + title);
1036+ }
1037+
10371038 // Create the instance
10381039 VkResult result = createInstance ();
10391040 if (result != VK_SUCCESS) {
0 commit comments