mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-14 00:10:57 +00:00
Move the function used to obtain the log file path into AppInfo::logFilePath() since it will be application-specific.
This commit is contained in:
parent
8b757692b1
commit
dc741814c9
6 changed files with 13 additions and 8 deletions
7
src/AppInfo.cpp
Normal file
7
src/AppInfo.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include "AppInfo.h"
|
||||||
|
|
||||||
|
std::string AppInfo::logFilePath()
|
||||||
|
{
|
||||||
|
return "update-log.txt";
|
||||||
|
}
|
||||||
|
|
|
@ -5,8 +5,11 @@
|
||||||
class AppInfo
|
class AppInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// Basic application information
|
||||||
static std::string name();
|
static std::string name();
|
||||||
static std::string appName();
|
static std::string appName();
|
||||||
|
|
||||||
|
static std::string logFilePath();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::string AppInfo::name()
|
inline std::string AppInfo::name()
|
||||||
|
|
|
@ -23,6 +23,7 @@ endif()
|
||||||
add_definitions(-DTIXML_USE_STL)
|
add_definitions(-DTIXML_USE_STL)
|
||||||
|
|
||||||
set (SOURCES
|
set (SOURCES
|
||||||
|
AppInfo.cpp
|
||||||
DirIterator.cpp
|
DirIterator.cpp
|
||||||
FileOps.cpp
|
FileOps.cpp
|
||||||
Log.cpp
|
Log.cpp
|
||||||
|
|
|
@ -80,9 +80,3 @@ void Log::write(Type type, const char* text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Log::defaultPath()
|
|
||||||
{
|
|
||||||
std::string path = "update-log.txt";
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ class Log
|
||||||
void write(Type type, const char* text);
|
void write(Type type, const char* text);
|
||||||
|
|
||||||
static Log* instance();
|
static Log* instance();
|
||||||
static std::string defaultPath();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void writeToStream(std::ostream& stream, Type type, const char* text);
|
static void writeToStream(std::ostream& stream, Type type, const char* text);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "AppInfo.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "ProcessUtils.h"
|
#include "ProcessUtils.h"
|
||||||
|
@ -51,7 +52,7 @@ void runUpdaterThread(void* arg)
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
Log::instance()->open(Log::defaultPath());
|
Log::instance()->open(AppInfo::logFilePath());
|
||||||
UpdaterOptions options;
|
UpdaterOptions options;
|
||||||
options.parse(argc,argv);
|
options.parse(argc,argv);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue