diff options
Diffstat (limited to 'src/burn/engine/logging.cpp')
| -rw-r--r-- | src/burn/engine/logging.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index 6b19cc8a..9aaf60ed 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp | |||
| @@ -39,11 +39,12 @@ extern "C" HRESULT LoggingOpen( | |||
| 39 | HRESULT hr = S_OK; | 39 | HRESULT hr = S_OK; |
| 40 | LPWSTR sczLoggingBaseFolder = NULL; | 40 | LPWSTR sczLoggingBaseFolder = NULL; |
| 41 | LPWSTR sczPrefixFormatted = NULL; | 41 | LPWSTR sczPrefixFormatted = NULL; |
| 42 | LPCWSTR wzPostfix = BURN_MODE_UNTRUSTED == pInternalCommand->mode ? L".cleanroom" : NULL; | ||
| 42 | 43 | ||
| 43 | hr = InitializeLogging(pLog, pInternalCommand); | 44 | hr = InitializeLogging(pLog, pInternalCommand); |
| 44 | ExitOnFailure(hr, "Failed to initialize logging."); | 45 | ExitOnFailure(hr, "Failed to initialize logging."); |
| 45 | 46 | ||
| 46 | if (pLog->dwAttributes & BURN_LOGGING_ATTRIBUTE_VERBOSE || pLog->dwAttributes & BURN_LOGGING_ATTRIBUTE_EXTRADEBUG) | 47 | if ((pLog->dwAttributes & BURN_LOGGING_ATTRIBUTE_VERBOSE) || (pLog->dwAttributes & BURN_LOGGING_ATTRIBUTE_EXTRADEBUG)) |
| 47 | { | 48 | { |
| 48 | if (pLog->dwAttributes & BURN_LOGGING_ATTRIBUTE_EXTRADEBUG) | 49 | if (pLog->dwAttributes & BURN_LOGGING_ATTRIBUTE_EXTRADEBUG) |
| 49 | { | 50 | { |
| @@ -54,9 +55,17 @@ extern "C" HRESULT LoggingOpen( | |||
| 54 | LogSetLevel(REPORT_VERBOSE, FALSE); | 55 | LogSetLevel(REPORT_VERBOSE, FALSE); |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 58 | // In these modes, make sure a log will be created even if the bundle wasn't configured to create one. | ||
| 57 | if ((!pLog->sczPath || !*pLog->sczPath) && (!pLog->sczPrefix || !*pLog->sczPrefix)) | 59 | if ((!pLog->sczPath || !*pLog->sczPath) && (!pLog->sczPrefix || !*pLog->sczPrefix)) |
| 58 | { | 60 | { |
| 59 | PathCreateTimeBasedTempFile(NULL, L"Setup", NULL, L"log", &pLog->sczPath, NULL); | 61 | hr = StrAllocString(&pLog->sczPrefix, L"Setup", 0); |
| 62 | ExitOnFailure(hr, "Failed to copy default log prefix."); | ||
| 63 | |||
| 64 | if (!pLog->sczExtension || !*pLog->sczExtension) | ||
| 65 | { | ||
| 66 | hr = StrAllocString(&pLog->sczExtension, L"log", 0); | ||
| 67 | ExitOnFailure(hr, "Failed to copy default log extension."); | ||
| 68 | } | ||
| 60 | } | 69 | } |
| 61 | } | 70 | } |
| 62 | 71 | ||
| @@ -134,7 +143,7 @@ extern "C" HRESULT LoggingOpen( | |||
| 134 | ExitOnFailure(hr, "Failed to get non-session specific TEMP folder."); | 143 | ExitOnFailure(hr, "Failed to get non-session specific TEMP folder."); |
| 135 | } | 144 | } |
| 136 | 145 | ||
| 137 | hr = LogOpen(sczLoggingBaseFolder, wzPrefix, NULL, pLog->sczExtension, FALSE, FALSE, &pLog->sczPath); | 146 | hr = LogOpen(sczLoggingBaseFolder, wzPrefix, wzPostfix, pLog->sczExtension, FALSE, FALSE, &pLog->sczPath); |
| 138 | if (FAILED(hr)) | 147 | if (FAILED(hr)) |
| 139 | { | 148 | { |
| 140 | LogDisable(); | 149 | LogDisable(); |
| @@ -760,7 +769,9 @@ static HRESULT InitializeLogging( | |||
| 760 | 769 | ||
| 761 | pLog->dwAttributes |= pInternalCommand->dwLoggingAttributes; | 770 | pLog->dwAttributes |= pInternalCommand->dwLoggingAttributes; |
| 762 | 771 | ||
| 763 | if (pInternalCommand->sczLogFile) | 772 | // The untrusted process needs a separate log file. |
| 773 | // TODO: Burn crashes if they do try to use the same log file. | ||
| 774 | if (pInternalCommand->sczLogFile && BURN_MODE_UNTRUSTED != pInternalCommand->mode) | ||
| 764 | { | 775 | { |
| 765 | hr = StrAllocString(&pLog->sczPath, pInternalCommand->sczLogFile, 0); | 776 | hr = StrAllocString(&pLog->sczPath, pInternalCommand->sczLogFile, 0); |
| 766 | ExitOnFailure(hr, "Failed to copy log file path from command line."); | 777 | ExitOnFailure(hr, "Failed to copy log file path from command line."); |
