19#include <FMEThirdPartyWarningsDisable.h>
22#include <FMEThirdPartyWarningsRestore.h>
65 bool useRichTextCoding =
true);
90 unsigned int * ){
return true; }
108 void logInfo (
const std::string &func,
const std::string &reason=
"");
125 void logFullInfo (
const std::string &func,
const std::string &reason);
257 const std::string &info,
267 void _sendMessage(std::string stringToSend);
270 bool _autoNewLineTerminate;
273 std::stringstream *_outputStream;
283 bool _useRichTextCodingFlag;
288 bool _updateProgressDuringInterruptChecksFlag;
291 bool _wasInterrupted;
294 std::string _fatalErrorPrefix;
297 std::string _errorPrefix;
300 std::string _warningPrefix;
303 std::string _infoPrefix;
324 double _stopTestTimeIntervalInSeconds;
327 double _checkStatusUpdateTimeIntervalInSeconds;
333 void *_checkFuncUserData;
double getStatusUpdateTimeIntervalInSeconds() const
void setInterruptCheckField(NotifyField *interruptField=nullptr)
virtual bool getInterruptedFlag() const
Returns current state of interruption flag (but does not check for interruption).
void logFullInfo(const std::string &func, const std::string &reason)
std::string getWarningMessagePrefix() const
FormatFlags
Enumerator describing some formatting flags.
void setInfoMessagePrefix(const std::string &msg)
void logInfo(const std::string &func, const std::string &reason="")
bool getRichTextCodingFlag() const
void logFullError(const std::string &func, MLErrorCode err, const std::string &reason)
See logFullFatalError() for details.
StringField * getStatusField() const
virtual bool _isStopPressed() const
void logWarning(const std::string &func, MLErrorCode err, const std::string &reason)
See logFatalError() for details.
void logError(const std::string &func, MLErrorCode err, const std::string &reason)
See logFatalError() for details.
bool hadFatalError() const
Returns true if any fatal error, error, warning or info was logged; can be reset with corresponding s...
void logAnyMessage(std::string msg, unsigned int formatFlags=NoFlags)
Log any string into the console.
static void _updateProgressIndicatorCB(void *userData, const std::string &info, float state)
void logFullWarning(const std::string &func, MLErrorCode err, const std::string &reason)
See logFullFatalError() for details.
void setAutoNewLineTermination(bool on)
Enable/disable automatic newline termination of logged messages.
void setErrorMessagePrefix(const std::string &msg)
virtual void updateProgressIndicator(const std::string &, float)
void setFatalErrorMessagePrefix(const std::string &msg)
Set/get prefixes for messages.
void logFullFatalError(const std::string &func, MLErrorCode err, const std::string &reason)
double getCheckTimeIntervalInSeconds() const
Returns the currently set interrupt check time interval.
virtual ~ProgressLogger()
Destructor.
void setHadWarningFlag(bool hadWarningFlag)
void setHadFlags(bool hadFlag)
Sets all had*Flags to hadFlag.
void logFatalError(const std::string &func, MLErrorCode err, const std::string &reason)
std::string getErrorMessagePrefix() const
void setCheckTimeIntervalInSeconds(double checkIntervalInSeconds)
void setStatusUpdateTimeIntervalInSeconds(double checkIntervalInSeconds)
std::string getInfoMessagePrefix() const
InterruptCheckFunc getInterruptCheckFunction() const
Returns the currently set function for interrupt checks.
void setRichTextCodingFlag(bool useRichTextCoding)
See getRichTextCodingFlag() for details.
bool(* InterruptCheckFunc)(void *userData)
Function type to check to for an interruption.
virtual void setInterruptedFlag(bool wasInterrupted)
Sets current state of interruption flag (but does not check for interruption).
bool getUpdateProgressDuringInterruptChecksFlag() const
virtual void _updateConsole(bool=true)
std::string getFatalErrorMessagePrefix() const
NotifyField * getInterruptCheckField() const
virtual bool messageHook(const ProgressLogger &, MLMessageType, const std::string *, const std::string *, MLErrorCode *, const std::string *, unsigned int *)
std::string _doAutoNewLineTerminate(const std::string &msg) const
Helper to terminate msg with newline at end according.
void setWarningMessagePrefix(const std::string &msg)
bool isAutoNewLineTerminationOn() const
Returns enabled/disabled automatic newline termination of logged messages.
virtual bool orToInterruptedFlag(bool wasInterrupted)
virtual bool wasInterrupted()
void setHadErrorFlag(bool hadErrorFlag)
void setInterruptCheckFunction(InterruptCheckFunc checkFunc, void *userData)
ProgressLogger(std::stringstream *outputStream=nullptr, NotifyField *intCheckField=nullptr, StringField *statusField=nullptr, bool useRichTextCoding=true)
void setHadInfoFlag(bool hadInfoFlag)
void setUpdateProgressDuringInterruptChecksFlag(bool callUpdateProgressDuringInterruptChecks)
See getUpdateProgressDuringInterruptChecksFlag() for details.
static bool isPressedField(NotifyField *fieldToCheck)
void setStatusField(StringField *statusField)
Set a StringField which always shall be updated with all logged messages; ignored if nullptr.
void * getInterruptCheckFunctionUserData() const
Returns the currently set user data pointer for interrupt checks.
void setHadFatalErrorFlag(bool hadFatalErrorFlag)
Sets the state of the corresponding _had* member; used to clear recent logging states.
Class to measure precise time intervals.
MLint32 MLErrorCode
Type of an ML Error code.
MLMessageType
Message types handled by the ErrorOutput class.