24 #ifndef PXRUSDMAYA_DIAGNOSTICDELEGATE_H
25 #define PXRUSDMAYA_DIAGNOSTICDELEGATE_H
29 #include "usdMaya/api.h"
33 #include "pxr/base/tf/diagnosticMgr.h"
35 #include "pxr/usd/usdUtils/coalescingDiagnosticDelegate.h"
37 #include <maya/MGlobal.h>
42 PXR_NAMESPACE_OPEN_SCOPE
74 const TfCallContext& context,
75 const std::string& msg)
override;
94 std::atomic_int _batchCount;
95 std::unique_ptr<UsdUtilsCoalescingDiagnosticDelegate> _batchedStatuses;
96 std::unique_ptr<UsdUtilsCoalescingDiagnosticDelegate> _batchedWarnings;
130 ~UsdMayaDiagnosticBatchContext();
133 const UsdMayaDiagnosticBatchContext&) =
delete;
134 UsdMayaDiagnosticBatchContext& operator=(
135 const UsdMayaDiagnosticBatchContext&) =
delete;
141 std::weak_ptr<UsdMayaDiagnosticDelegate> _delegate;
144 PXR_NAMESPACE_CLOSE_SCOPE
As long as a batch context remains alive (process-wide), the UsdMayaDiagnosticDelegate will save diag...
PXRUSDMAYA_API void IssueFatalError(const TfCallContext &context, const std::string &msg) override
Called when a TF_FATAL_ERROR is issued (or a failed TF_AXIOM).
static PXRUSDMAYA_API int GetBatchCount()
Returns the number of active batch contexts associated with the global delegate.
PXRUSDMAYA_API void IssueWarning(const TfWarning &warning) override
Called when a TF_WARNING() is issued.
static PXRUSDMAYA_API void InstallDelegate()
Installs a shared delegate globally.
PXRUSDMAYA_API UsdMayaDiagnosticBatchContext()
Constructs a batch context, causing all subsequent diagnostic messages to be batched on all threads...
PXRUSDMAYA_API void IssueStatus(const TfStatus &status) override
Called when a TF_STATUS() is issued.
PXRUSDMAYA_API void IssueError(const TfError &err) override
Called when a TfError is posted.
Represents an object that contains information about a status message.
Represents an object that contains error information.
static PXRUSDMAYA_API void RemoveDelegate()
Removes the global shared delegate, if it exists.
Converts Tf diagnostics into native Maya infos, warnings, and errors.
Represents an object that contains information about a warning.
One may set a delegate with the TfDiagnosticMgr which will be called to respond to errors and diagnos...