aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/logging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/logging.cpp')
-rw-r--r--src/burn/engine/logging.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp
index 1e436f68..7c048523 100644
--- a/src/burn/engine/logging.cpp
+++ b/src/burn/engine/logging.cpp
@@ -227,6 +227,49 @@ extern "C" void LoggingIncrementPackageSequence()
227 ++vdwPackageSequence; 227 ++vdwPackageSequence;
228} 228}
229 229
230extern "C" HRESULT LoggingSetCompatiblePackageVariable(
231 __in BURN_PACKAGE* pPackage,
232 __in BURN_LOGGING* pLog,
233 __in BURN_VARIABLES* pVariables,
234 __out_opt LPWSTR* psczLogPath
235 )
236{
237 HRESULT hr = S_OK;
238 LPWSTR sczLogPathVariable = NULL;
239 LPWSTR sczLogPath = NULL;
240
241 // Make sure that no package log files are created when logging has been disabled via Log element.
242 if (BURN_LOGGING_STATE_DISABLED == pLog->state)
243 {
244 ExitFunction();
245 }
246
247 if (pPackage->sczLogPathVariable && *pPackage->sczLogPathVariable)
248 {
249 // Format a suitable log path variable from the original package.
250 hr = StrAllocFormatted(&sczLogPathVariable, L"%ls_Compatible", pPackage->sczLogPathVariable);
251 ExitOnFailure(hr, "Failed to format log path variable for compatible package.");
252
253 hr = StrAllocFormatted(&sczLogPath, L"%ls_%03u_%ls_%ls.%ls", pLog->sczPrefix, vdwPackageSequence, pPackage->sczId, pPackage->compatiblePackage.compatibleEntry.sczId, pLog->sczExtension);
254 ExitOnFailure(hr, "Failed to allocate path for package log.");
255
256 hr = VariableSetString(pVariables, sczLogPathVariable, sczLogPath, FALSE, FALSE);
257 ExitOnFailure(hr, "Failed to set log path into variable.");
258
259 if (psczLogPath)
260 {
261 hr = StrAllocString(psczLogPath, sczLogPath, 0);
262 ExitOnFailure(hr, "Failed to copy package log path.");
263 }
264 }
265
266LExit:
267 ReleaseStr(sczLogPathVariable);
268 ReleaseStr(sczLogPath);
269
270 return hr;
271}
272
230extern "C" HRESULT LoggingSetPackageVariable( 273extern "C" HRESULT LoggingSetPackageVariable(
231 __in BURN_PACKAGE* pPackage, 274 __in BURN_PACKAGE* pPackage,
232 __in_z_opt LPCWSTR wzSuffix, 275 __in_z_opt LPCWSTR wzSuffix,