Commit e30847e6 authored by Nicolas Jager's avatar Nicolas Jager

internal : save debug output to file

Change-Id: Id637ece76a98ad4ad8a45944b1c356cc57f263c9
Tuleap: #1224
parent 6ddd60a2
......@@ -24,6 +24,7 @@ using namespace RingClientUWP;
using namespace Platform;
using namespace Windows::UI::Core;
using namespace Windows::Storage;
void
RingDebug::print(const std::string& message,
......@@ -53,5 +54,21 @@ RingDebug::print(const std::string& message,
OutputDebugString((wString + L"\n").c_str());
/* fire the event. */
messageToScreen(ref new String(wString.c_str(), wString.length()));
}
\ No newline at end of file
auto line = ref new String(wString.c_str(), wString.length());
messageToScreen(line);
FileIO::AppendTextAsync(_logFile, line+"\n");
}
RingClientUWP::RingDebug::RingDebug()
{
StorageFolder^ storageFolder = ApplicationData::Current->LocalFolder;
StorageFile^ logFile;
task<StorageFile^>(storageFolder->CreateFileAsync("debug.log", CreationCollisionOption::ReplaceExisting)).then([this](StorageFile^ file)
{
this->_logFile = file;
});
}
......@@ -17,6 +17,8 @@
**************************************************************************/
#pragma once
using namespace Windows::Storage;
namespace RingClientUWP
{
......@@ -40,6 +42,8 @@ public:
}
}
property StorageFile^ _logFile;
/* properties */
/* functions */
......@@ -51,7 +55,7 @@ internal:
event debugMessageToScreen^ messageToScreen;
private:
RingDebug() {}; // singleton
RingDebug(); // singleton
};
void WriteLine(String^ str)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment