mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-23 23:36:18 +00:00
Fixed: #990 Add possibility to set and get log directory
This commit is contained in:
parent
d03683a23c
commit
f5f7c53a40
2 changed files with 13 additions and 2 deletions
|
@ -89,6 +89,9 @@ void destroyDebug();
|
|||
// call this if you want to change the dir of the log.log file
|
||||
void changeLogDirectory(const std::string &dir);
|
||||
|
||||
// call this if you want to get the dir of the log.log file
|
||||
std::string getLogDirectory();
|
||||
|
||||
// internal breakpoint window
|
||||
void enterBreakpoint (const char *message);
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ namespace NLMISC
|
|||
bool DisableNLDebug= false;
|
||||
NLMISC::CVariablePtr<bool> _DisableNLDebug("nel","DisableNLDebug","Disables generation and output of nldebug logs (no code associated with the log generation is executed)",&DisableNLDebug,true);
|
||||
|
||||
static std::string LogPath = "";
|
||||
|
||||
//bool DebugNeedAssert = false;
|
||||
//bool NoAssert = false;
|
||||
|
@ -1116,10 +1117,16 @@ void getCallStackAndLog (string &result, sint /* skipNFirst */)
|
|||
void changeLogDirectory(const std::string &dir)
|
||||
{
|
||||
if (fd == NULL)return;
|
||||
string p = CPath::standardizePath(dir) + "log.log";
|
||||
LogPath = CPath::standardizePath(dir);
|
||||
string p = LogPath + "log.log";
|
||||
fd->setParam(p);
|
||||
}
|
||||
|
||||
std::string getLogDirectory()
|
||||
{
|
||||
return LogPath;
|
||||
}
|
||||
|
||||
// You should not call this, unless you know what you're trying to do (it kills debug/log)!
|
||||
// Destroys debug environment, to clear up the memleak log.
|
||||
// NeL context must be deleted immediately after debug destroyed,
|
||||
|
@ -1196,7 +1203,8 @@ void createDebug (const char *logPath, bool logInFile, bool eraseLastLog)
|
|||
string fn;
|
||||
if (logPath != NULL)
|
||||
{
|
||||
fn += logPath;
|
||||
LogPath = CPath::standardizePath(logPath);
|
||||
fn += LogPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue