Add a function for formatting log messages

This commit is contained in:
Robbert van der Helm
2020-03-07 16:48:41 +01:00
parent 356d6a6efc
commit 77b2d1b44a
2 changed files with 47 additions and 0 deletions
+19
View File
@@ -76,11 +76,30 @@ class Logger {
*/
static Logger create_from_environment(std::string prefix = "");
/**
* Write a message to the log, prefixing it with a timestamp and this
* logger's prefix string.
*
* @param message The message to write.
*/
void log(const std::string& message);
// TODO: Add dedicated logging functions for events and the Wine process's
// STDOUT and STDERR
private:
/**
* The output stream to write the log messages to. Typically either STDERR
* or a file stream.
*/
std::ostream& stream;
/**
* The verbosity level of this logger instance. Based on this certain
* messages may or may not be shown.
*/
Verbosity verbosity;
/**
* A prefix that gets prepended before every message.
*/
std::string prefix;
};