The log messages are written to one or more loggers registered with the ResourceManager.
if(myErrorOccured) { // my annotator couldn't create a result file for this document: // report an error but continue execution getAnnotatorContext().getLogger().logError("Could not create result file"); // continue execution }
if(myErrorOccured) { // my annotator couldn't create a result file for this document: // report an error but continue execution // get a error log stream object LogStream & errStream = getAnnotatorContext().getLogger().getLogStream(LogStream::EnError); // stream out error message errStream << "Could not create result file" << strFilename << endl; errStream << "(continuing execution)"; // terminate error message errStream.flush(); // continue execution }
UIMA_LOG_STREAM_ERROR(getAnnotatorContext().getLogger(), "Could not create result file" << strFilename << endl << "(continuing execution)");
Public Member Functions | |
Constructors | |
LogFacility (icu::UnicodeString const &) | |
Create a new instance of a log facility. | |
LogFacility (icu::UnicodeString const &, LogStream::EnEntryType level) | |
this constructor gets the handle to loggers from the ResourceManager. | |
~LogFacility () | |
Properties | |
const TCHAR * | getLastErrorAsCStr (void) const |
ErrorInfo const & | getLastError () const |
LogStream Functions | |
LogStream & | getLogStream (LogStream::EnEntryType enLogEntryType) |
void | flushLogStream () |
Log Functions | |
void | logMessage (const TCHAR *cpszMessage, long lUserCode=0) const |
Log the specified message together with a user-defined id. | |
void | logMessage (const std::string &crclMessage, long lUserCode=0) const |
Log the specified message together with a user-defined id. | |
void | logMessage (const icu::UnicodeString &crclMessage, long lUserCode=0) const |
Log the specified message together with a user-defined id. | |
void | logWarning (const TCHAR *cpszMessage, long lUserCode=0) const |
Log the specified warning together with a user-defined id. | |
void | logWarning (const std::string &crclMessage, long lUserCode=0) const |
Log the specified warning together with a user-defined id. | |
void | logWarning (const icu::UnicodeString &crclMessage, long lUserCode=0) const |
Log the specified warning together with a user-defined id. | |
void | logWarning (const ErrorInfo &crclErrorInfo) const |
Log the specified warning. | |
void | logError (const TCHAR *cpszMessage, long lUserCode=0) const |
Log the specified error together with a user-defined id. | |
void | logError (const std::string &crclMessage, long lUserCode=0) const |
Log the specified error together with a user-defined id. | |
void | logError (const icu::UnicodeString &crclMessage, long lUserCode=0) const |
Log the specified error together with a user-defined id. | |
void | logError (const ErrorInfo &crclErrorInfo) const |
Log the specified error. |
uima::LogFacility::LogFacility | ( | icu::UnicodeString const & | ) |
Create a new instance of a log facility.
cpszAppKey
must denote the key of the application. this constructor gets handle to the loggers from the ResourceManager and sets the mininum log level to INFO. This is used in the AnnotatorContext to create separate instances of the LogFacility for each annotator.
uima::LogFacility::LogFacility | ( | icu::UnicodeString const & | , | |
LogStream::EnEntryType | level | |||
) |
this constructor gets the handle to loggers from the ResourceManager.
This constructor is used by the framework ResourceManager
uima::LogFacility::~LogFacility | ( | ) |
const TCHAR* uima::LogFacility::getLastErrorAsCStr | ( | void | ) | const |
ErrorInfo const& uima::LogFacility::getLastError | ( | ) | const |
LogStream& uima::LogFacility::getLogStream | ( | LogStream::EnEntryType | enLogEntryType | ) |
void uima::LogFacility::flushLogStream | ( | ) |
void uima::LogFacility::logMessage | ( | const TCHAR * | cpszMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logMessage | ( | const std::string & | crclMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logMessage | ( | const icu::UnicodeString & | crclMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logWarning | ( | const TCHAR * | cpszMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logWarning | ( | const std::string & | crclMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logWarning | ( | const icu::UnicodeString & | crclMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logWarning | ( | const ErrorInfo & | crclErrorInfo | ) | const |
Log the specified warning.
void uima::LogFacility::logError | ( | const TCHAR * | cpszMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logError | ( | const std::string & | crclMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logError | ( | const icu::UnicodeString & | crclMessage, | |
long | lUserCode = 0 | |||
) | const [inline] |
void uima::LogFacility::logError | ( | const ErrorInfo & | crclErrorInfo | ) | const |
Log the specified error.