Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
#include <iomanip>
#include <chrono>
#include <stdio.h>
+#include "platform.h"
#include "logger.h"
#ifdef DEBUGGER_FOR_TIZEN
FileLogger::FileLogger()
{
auto time = std::time(nullptr);
+ std::string tmpPath = GetTempFolder();
std::ostringstream oss;
oss << std::put_time(std::localtime(&time), "%Y_%m_%d__%H_%M_%S");
- logFile = fopen(std::string(filenameBase + oss.str() + ".log").c_str(), "w+");
+ logFile = fopen(std::string(tmpPath + filenameBase + oss.str() + ".log").c_str(), "w+");
}
FileLogger::~FileLogger()
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <stdlib.h>
#if defined(__APPLE__)
#include <mach-o/dyld.h>
#endif
+std::string GetTempFolder()
+{
+#ifdef WIN32
+ CHAR path[MAX_PATH];
+ DWORD len = GetTempPathA(MAX_PATH - 1, path);
+ return std::string(path, len);
+#elif __APPLE__
+ char *pPath = getenv("TMPDIR");
+
+ if (pPath != nullptr)
+ return std::string(pPath);
+ else
+ return "";
+#else //WIN32
+ return "/tmp/";
+#endif // WIN32
+}
+
+
IORedirectServer::operator bool() const
{
return m_handles->IsConnected();
void *DLOpen(const std::string &path);
void *DLSym(void *handle, const std::string &name);
void UnsetCoreCLREnv();
+std::string GetTempFolder();
class IORedirectServerHandles;