29 #include <osgDB/FileNameUtils> 37 , mFileName(osgDB::getSimpleFileName(filename))
46 std::cerr <<
"Exception: " <<
mMessage << std::endl <<
54 std::ostringstream ss;
77 "Exception Thrown: " +
mMessage, level);
Log class which the engine uses for all of its logging needs.
std::string ToString() const
Converts this exception to a string.
void LogMessage(const std::string &cppFile, const std::string &method, int line, const std::string &msg, LogLevel logLevel) const
Logs a time-stamped message.
virtual ~Exception()
Destructor.
This is the exception class used throughout the engine.
Exception(const std::string &message, const std::string &filename, unsigned int linenum)
Constructor - Initializes the exception and logs it.
bool IsLevelEnabled(LogLevel logLevel) const
Queries if a level is enabled.
void Print() const
Prints the exception to the console.
unsigned int Line() const
The line number associated with this exception.
void LogException(trUtil::Logging::LogLevel level=trUtil::Logging::LogLevel::LOG_ERROR) const
Logs the exception to the default logger.
TR_UTIL_EXPORT std::ostream & operator<<(std::ostream &os, const EnumerationString &e)
Helper method to print EnumerationNumeric to an output stream.
const std::string & File() const
The filename associated with this exception.
A class that represents date time utility.
Namespace that holds various utility classes for the engine.
const std::string & What() const
The message to be displayed when this exception is thrown.
static Log & GetInstance(const std::string &name=Log::LOG_DEFAULT_NAME)
Retrieve singleton instance of the log class for a give string name.