PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Logfile

Hello,

short question, is it possible to redirect the output of the logfile to another destination?
Instead of <appdir>.logfile.txt to c:\temp\log.txt ?

congratulations for vice world champs.
Hi Yucani,

If you want to write a log file to a different location, we recommend implementing your own logging functionality.

Here is a small sample:
Code:

void logtext(const char *text, bool newline = true)
{
bool opened;
ClassEFile ef;
opened = ef.Open("yourpath/log.txt");
if (!opened)
opened = ef.New("yourpath/log.txt");
if (opened)
{
ef.Seek(ef.Size());
ef.Write(text, ClassEStd::StrLen(text));
if (newline)
{
char newlinestr[] = "\r\n";
ef.Write(newlinestr, 2);
}
ef.Close();
}
}
thx