50int Object::tracebackMode = -1;
54 tracebackMode = (tracebackModeIn != -1) ? tracebackModeIn : tracebackMode;
60 tracebackMode = (tracebackModeIn != -1) ? tracebackModeIn : tracebackMode;
66 tracebackMode = (tracebackModeIn != -1) ? tracebackModeIn : tracebackMode;
69void Object::setLabel (
const char* theLabel) {
70 label_ = std::string (theLabel);
75 if (tracebackModeValue < 0) {
76 tracebackModeValue = 0;
78 Object tempObject (tracebackModeValue);
83 int temp = Object::tracebackMode;
85 temp = Teuchos_DefaultTracebackMode;
110 if (tracebackMode == 1 && errorCode < 0) {
112 cerr << endl <<
"Error in Teuchos Object with label: " << label_
113 << endl <<
"Teuchos Error: " << message <<
" Error Code: "
114 << errorCode << endl;
117 if (tracebackMode == 2 && errorCode != 0) {
118 cerr << endl <<
"Error in Teuchos Object with label: " << label_
119 << endl <<
"Teuchos Error: " << message <<
" Error Code: "
120 << errorCode << endl;
128 return label_.c_str ();
133 os << obj.
label () << std::endl;
virtual void print(std::ostream &os) const
Print the object to the given output stream.
static int getTracebackMode()
Get the value of the Object error traceback report mode.
virtual const char * label() const
Access the object's label (LEGACY; return std::string instead).
static void setTracebackMode(int tracebackModeValue)
Set the value of the Object error traceback report mode.
virtual int reportError(const std::string message, int errorCode) const
Report an error with this Object.
Object(int tracebackModeIn=-1)
Default Constructor.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...