SWDEV-532576 - clr_logs_<pid>.txt default AMD_LOG_LEVEL_FILE (#480)

avoids app crash and uses default AMD_LOG_LEVEL_FILE if invalid name is passed
This commit is contained in:
GunaShekar, Ajay
2025-08-13 20:27:42 -07:00
committed by GitHub
parent 191f068193
commit 76637d7ebe
+5 -1
View File
@@ -151,8 +151,12 @@ bool Flag::init() {
if (!flagIsDefault(AMD_LOG_LEVEL)) {
if (!flagIsDefault(AMD_LOG_LEVEL_FILE)) {
std::string fileName = AMD_LOG_LEVEL_FILE;
fileName = fileName + "_" + std::to_string(Os::getProcessId());
std::string pid = std::to_string(Os::getProcessId());
fileName = fileName + "_" + pid;
outFile = fopen(fileName.c_str(), "a");
if (outFile == NULL) {
outFile = fopen(("clr_logs_" + pid + ".txt").c_str(), "a");
}
}
}