Commit 32b311c4 authored by Aleksandr Bakhshiev's avatar Aleksandr Bakhshiev
Browse files

Implemented new log save modes.

parent 7c6181a6a866
......@@ -94,7 +94,7 @@ int UAppCore<ApplicationT, EngineControlT, ProjectT, ServerControlT, TestManager
{
// ini
RDK::UIniFile<char> projectIniFile;
projectIniFile.LoadFromFile("VideoAnalytics.ini");
projectIniFile.LoadFromFile(RDK::extract_file_name_wo_ext(application_file_name)+".ini");
startProjectName = projectIniFile("General", "AutoexecProjectFileName", "");
autoStartProjectFlag = RDK::atoi(projectIniFile("General", "autoStartProjectFlag", "0"));
hideAdminForm = RDK::atoi(projectIniFile("General", "HideAdminForm", "0"));
......
......@@ -1297,7 +1297,8 @@ bool UApplication::OpenProject(const std::string &filename)
TProjectConfig config=Project->GetConfig();
GetCore()->GetLogger(RDK_GLOB_MESSAGE)->SetEventsLogMode(config.EventsLogFlag);
GetCore()->GetLogger(RDK_GLOB_MESSAGE)->Clear();
if(LogCreationMode != 3)
GetCore()->GetLogger(RDK_GLOB_MESSAGE)->Clear();
// EngineControl->GetEngineStateThread()->SetLogFlag(config.EventsLogFlag);
// EngineControl->GetEngineStateThread()->CloseEventsLogFile();
// EngineControl->GetEngineStateThread()->SetLogDir(ProjectPath);
......
......@@ -368,7 +368,8 @@ void UEngineControl::PauseChannel(int channel_index)
break;
}
GetCore()->GetLogger(RDK_GLOB_MESSAGE)->Clear();
if(Application && Application->GetLogCreationMode() == 0)
GetCore()->GetLogger(RDK_GLOB_MESSAGE)->Clear();
// EngineStateThread->CloseEventsLogFile();
}
......
......@@ -268,6 +268,17 @@ std::string extract_file_name(const std::string& full_name)
: full_name.substr(pos+1);
}
///
std::string extract_file_name_wo_ext(const std::string& full_name)
{
std::string file_name=extract_file_name(full_name);
size_t pos = file_name.find_last_of(".");
return (std::string::npos == pos)
? file_name
: file_name.substr(0,pos);
}
///
RDK_LIB_TYPE std::string extract_file_ext(const std::string& full_name)
{
......
......@@ -369,6 +369,9 @@ RDK_LIB_TYPE std::string extract_file_path(const std::string& full_name);
///
RDK_LIB_TYPE std::string extract_file_name(const std::string& full_name);
///
RDK_LIB_TYPE std::string extract_file_name_wo_ext(const std::string& full_name);
///
RDK_LIB_TYPE std::string extract_file_ext(const std::string& full_name);
......
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