ultimatepp/uppsrc/ide/Log.cpp
cxl d21c741333 CtrlLib: MenuBar now resilient to destroying menu while invoked menuitem event is running
git-svn-id: svn://ultimatepp.org/upp/trunk@11457 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2017-11-12 22:51:50 +00:00

36 lines
764 B
C++

#include "ide.h"
#define METHOD_NAME "Ide::" << UPP_FUNCTION_NAME << "(): "
String Ide::GetIdeLogPath()
{
return GetStdLogPath();
}
String Ide::GetTargetLogPath()
{
if(target.GetCount() == 0)
return Null;
#ifdef PLATFORM_WIN32
return ForceExt(target, ".log");
#else
String p = GetFileTitle(target);
return GetHomeDirFile(".upp/" + p + "/" + p + ".log");
#endif
}
void Ide::OpenLog(const String& logFilePath)
{
String normalizedPath = NormalizePath(logFilePath);
if(!designer && normalizedPath == editfile) {
History(-1);
return;
}
AddHistory();
if(!FileExists(logFilePath)) {
Loge() << METHOD_NAME << "Following log file doesn't exist: \"" << logFilePath << "\".";
return;
}
EditFile(logFilePath);
}