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:
Robert Knight 2011-08-23 23:54:37 +01:00
parent a5bf5becad
commit 4f00c51c8f
3 changed files with 9 additions and 1 deletions

View file

@ -80,3 +80,9 @@ void Log::write(Type type, const char* text)
}
}
std::string Log::defaultPath()
{
std::string path = "update-log.txt";
return path;
}

View file

@ -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)

View file

@ -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);