78 template<
typename N >
79 class sxt :
public std::runtime_error
111 if ( !
file.empty() )
113 std::ostringstream ss;
114 ss <<
" [" <<
file <<
":" <<
line <<
"]";
115 buff.append( ss.str() );
132 std::ostringstream ss;
137 ptr += ss.str().length();
141 buff.append( ss.str() );
151 virtual const char *
what()
const throw()
159 static std::vector< std::string >snames;
160 if ( snames.size() == 0)
162 snames.push_back(
"Emergency" );
163 snames.push_back(
"Alert" );
164 snames.push_back(
"Critical" );
165 snames.push_back(
"Error" );
166 snames.push_back(
"Code" );
167 snames.push_back(
"Warning" );
168 snames.push_back(
"Notice" );
169 snames.push_back(
"Info" );
170 snames.push_back(
"Debug" );
172 return snames[(int)s];
209 #define SX(x) sx(x, __FILE__, __LINE__ )
Information messages.
Definition: sx.h:56
sxt(Severity s)
constructor
Definition: sx.h:93
sxt & operator<<(T x)
Provide stream syntax for the exception object.
Definition: sx.h:130
int ptr
insertion point for message text
Definition: sx.h:86
A programming error has been detected.
Definition: sx.h:53
static const std::string & sevToString(SASSY::Severity s)
Convert a severity into a string.
Definition: sx.h:157
There is a problem but the program can continue.
Definition: sx.h:54
An exception object with severity levels.
Definition: sx.h:79
Debugging messages.
Definition: sx.h:57
Something is odd.
Definition: sx.h:55
Severity severity()
get the severity of the exception
Definition: sx.h:148
std::string file
source file from which it was thrown
Definition: sx.h:84
Severity
Severity levels for log messages.
Definition: sx.h:48
Severity mSeverity
severity level of the exception
Definition: sx.h:82
A configuration error has been detected.
Definition: sx.h:50
std::string buff
message built into this
Definition: sx.h:83
The program cannot continue and may have corrupted its data.
Definition: sx.h:51
sxt(Severity s, const std::string &f, int ln)
constructor
Definition: sx.h:106
A fault has been detected which may compromise the computer.
Definition: sx.h:49
int line
line number in the source file
Definition: sx.h:85
The program cannot continue.
Definition: sx.h:52
virtual const char * what() const
get the message from the exception
Definition: sx.h:151