mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0029451: Information Message Alert to debug an algorithm or object functionality
- Added possibility to send stream information and transient object into Message_Messenger. Message_Printer will process it if needed. - Add Message_PrinterToReport to send messenger information into Message_Report. - Extended Message_Report to collect hierarchical alerts, to be able to collect some metrics during alerts processing. - Added Message_AlertExtended to prepare hierarchical alerts with custom attributes. One attribute for one alert. - Added Message_CompositeAlerts class to handle a container of alerts. - Added Message_Level to start a new hierarchical level by creating an instance, stop by destricting. - Added Message_Attribute and inheritors to store custom information about alert like object, stream, shape, some metrics. - Implement Message_AttributeAlert to collect start/stop information about active metrics of Message_Report. This kind of attribute is created if at least one metric is active in the report. - Add Message_MetricType enumeration with possible kinds of metrics in report. - Implement DumpJson for Message_Report to store all collected alerts into stream. - Added draw commands for Message_Report, Message_Messenger.
This commit is contained in:
@@ -76,7 +76,7 @@ public:
|
||||
{
|
||||
if (myMessenger)
|
||||
{
|
||||
myMessenger->Send(myStream.str().c_str(), myGravity);
|
||||
myMessenger->Send(myStream, myGravity);
|
||||
}
|
||||
myStream.str(std::string()); // empty the buffer for possible reuse
|
||||
}
|
||||
@@ -177,6 +177,10 @@ public:
|
||||
Standard_EXPORT void Send (const Standard_CString theString,
|
||||
const Message_Gravity theGravity = Message_Warning) const;
|
||||
|
||||
//! See above
|
||||
Standard_EXPORT void Send (const Standard_SStream& theStream,
|
||||
const Message_Gravity theGravity = Message_Warning) const;
|
||||
|
||||
//! See above
|
||||
Standard_EXPORT void Send (const TCollection_AsciiString& theString,
|
||||
const Message_Gravity theGravity = Message_Warning) const;
|
||||
@@ -188,6 +192,9 @@ public:
|
||||
//! Create string buffer for message of specified type
|
||||
StreamBuffer Send (Message_Gravity theGravity) { return StreamBuffer (this, theGravity); }
|
||||
|
||||
//! See above
|
||||
Standard_EXPORT void Send (const Handle(Standard_Transient)& theObject, const Message_Gravity theGravity = Message_Warning) const;
|
||||
|
||||
//! Create string buffer for sending Fail message
|
||||
StreamBuffer SendFail () { return Send (Message_Fail); }
|
||||
|
||||
@@ -218,6 +225,9 @@ public:
|
||||
//! Short-cut to Send (theMessage, Message_Trace)
|
||||
void SendTrace (const TCollection_AsciiString& theMessage) { Send (theMessage, Message_Trace); }
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
|
||||
private:
|
||||
|
||||
Message_SequenceOfPrinters myPrinters;
|
||||
|
Reference in New Issue
Block a user