34 #include "../Exception.h" 89 void setPrefix(
const std::string& prefix);
120 void printEx(
const std::string& file, uint32_t line,
const std::string&
function,
const std::string& what =
"");
168 void printInfo(
const std::string& message);
181 void printDebug(
const std::string& message, int32_t minDebugLevel = 5);
195 void printMessage(
const std::string& message, int32_t minDebugLevel = 0,
bool errorLog =
false);
215 std::atomic_bool _stdOutput{
true };
220 static std::mutex _outputMutex;
225 std::function<void(int32_t, const std::string&)> _outputCallback;
void setPrefix(const std::string &prefix)
Sets a string, which will be used to prefix all output.
Definition: Output.cpp:47
void printError(const std::string &message)
Prints an error message (debug level < 2).
Definition: Output.cpp:149
void init(SharedObjects *baseLib)
Initializes the object.
Definition: Output.cpp:71
This is the base library main class.
Definition: BaseLib.h:95
Definition: BaseLib.cpp:34
void printWarning(const std::string &message)
Prints a warning message (debug level < 3).
Definition: Output.cpp:166
Class to print output of different kinds to the standard and error output.
Definition: Output.h:54
void printMessage(const std::string &message, int32_t minDebugLevel=0, bool errorLog=false)
Prints a message regardless of the current debug level.
Definition: Output.cpp:213
PVariable value
Definition: UiElements.h:217
void printCritical(const std::string &message)
Prints a critical error message (debug level < 1).
Definition: Output.cpp:132
void printDebug(const std::string &message, int32_t minDebugLevel=5)
Prints a debug message (debug level < 5).
Definition: Output.cpp:198
static std::string getTimeString(int64_t time=0)
Returns a time string like "08/27/14 14:13:53.471".
Definition: Output.cpp:76
void setOutputCallback(std::function< void(int32_t, const std::string &)> value)
Sets a callback function which will be called for all messages.
Definition: Output.cpp:62
void disableStdOutput()
Disables standard output and standard error.
Definition: Output.cpp:57
std::string getPrefix()
Returns the prefix previously defined with setPrefix.
Definition: Output.cpp:42
Output()
The main constructor.
virtual ~Output()
The destructor.
void printInfo(const std::string &message)
Prints a info message (debug level < 4).
Definition: Output.cpp:183
void printEx(const std::string &file, uint32_t line, const std::string &function, const std::string &what="")
Prints an error message with filename, line number and function name.
Definition: Output.cpp:101
void enableStdOutput()
Enables standard output and standard error.
Definition: Output.cpp:52