mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-04-18 03:50:42 +00:00
Write log output to a file instead of just stderr
* Log output to a file (currently update-log.txt in the updater's current directory) * Use correct stream type for Log::m_output
This commit is contained in:
parent
a5bf5becad
commit
4f00c51c8f
3 changed files with 9 additions and 1 deletions
|
@ -80,3 +80,9 @@ void Log::write(Type type, const char* text)
|
|||
}
|
||||
}
|
||||
|
||||
std::string Log::defaultPath()
|
||||
{
|
||||
std::string path = "update-log.txt";
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,11 +22,12 @@ class Log
|
|||
void write(Type type, const char* text);
|
||||
|
||||
static Log* instance();
|
||||
static std::string defaultPath();
|
||||
|
||||
private:
|
||||
static void writeToStream(std::ostream& stream, Type type, const char* text);
|
||||
|
||||
std::fstream m_output;
|
||||
std::ofstream m_output;
|
||||
};
|
||||
|
||||
inline void Log::write(Type type, const std::string& text)
|
||||
|
|
|
@ -29,6 +29,7 @@ void runUpdaterThread(void* arg)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Log::instance()->open(Log::defaultPath());
|
||||
UpdaterOptions options;
|
||||
options.parse(argc,argv);
|
||||
|
||||
|
|
Loading…
Reference in a new issue