mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Create log file in process dir instead of current working dir
This commit is contained in:
parent
b4ef2a1c0c
commit
97e08f7988
@ -76,7 +76,7 @@ namespace Compat
|
|||||||
s_logFile << std::endl;
|
s_logFile << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log::initLogging(std::string processName)
|
void Log::initLogging(const std::string& processDir, std::string processName)
|
||||||
{
|
{
|
||||||
if (processName.length() >= 4 &&
|
if (processName.length() >= 4 &&
|
||||||
0 == _strcmpi(processName.substr(processName.length() - 4).c_str(), ".exe"))
|
0 == _strcmpi(processName.substr(processName.length() - 4).c_str(), ".exe"))
|
||||||
@ -87,7 +87,7 @@ namespace Compat
|
|||||||
for (int i = 1; i < 100; ++i)
|
for (int i = 1; i < 100; ++i)
|
||||||
{
|
{
|
||||||
std::ostringstream logFileName;
|
std::ostringstream logFileName;
|
||||||
logFileName << "DDrawCompat-" << processName;
|
logFileName << processDir << '\\' << "DDrawCompat-" << processName;
|
||||||
if (i > 1)
|
if (i > 1)
|
||||||
{
|
{
|
||||||
logFileName << '[' << i << ']';
|
logFileName << '[' << i << ']';
|
||||||
|
@ -166,7 +166,7 @@ namespace Compat
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initLogging(std::string processName);
|
static void initLogging(const std::string& processDir, std::string processName);
|
||||||
static bool isPointerDereferencingAllowed() { return s_isLeaveLog || 0 == s_outParamDepth; }
|
static bool isPointerDereferencingAllowed() { return s_isLeaveLog || 0 == s_outParamDepth; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -230,7 +230,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto processPath = getModulePath(nullptr);
|
auto processPath = getModulePath(nullptr);
|
||||||
Compat::Log::initLogging(getFileName(processPath));
|
Compat::Log::initLogging(getDirName(processPath), getFileName(processPath));
|
||||||
|
|
||||||
Compat::Log() << "Process path: " << processPath;
|
Compat::Log() << "Process path: " << processPath;
|
||||||
printEnvironmentVariable("__COMPAT_LAYER");
|
printEnvironmentVariable("__COMPAT_LAYER");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user