Commit 121d3e84 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac901] The impl can output and lookup message

parent c3dad479
...@@ -194,6 +194,26 @@ LoggerImpl::isDebugEnabled(int dbglevel) { ...@@ -194,6 +194,26 @@ LoggerImpl::isDebugEnabled(int dbglevel) {
} }
// Output a general message // Output a general message
string*
LoggerImpl::lookupMessage(const MessageID& ident) {
return (new string(string(ident) + ", " +
MessageDictionary::globalDictionary().getText(ident)));
}
void
LoggerImpl::outputRaw(const char* sevText, const string& message) {
// Get the time in a struct tm format, and convert to text
time_t t_time;
time(&t_time);
struct tm* tm_time = localtime(&t_time);
char chr_time[32];
(void) strftime(chr_time, sizeof(chr_time), "%Y-%m-%d %H:%M:%S", tm_time);
// Now output.
cout << chr_time << " " << sevText << " [" << getName() << "] " <<
message << endl;
}
void void
LoggerImpl::output(const char* sev_text, const MessageID& ident, LoggerImpl::output(const char* sev_text, const MessageID& ident,
......
...@@ -179,6 +179,8 @@ public: ...@@ -179,6 +179,8 @@ public:
void output(const char* sev_text, const MessageID& ident, void output(const char* sev_text, const MessageID& ident,
va_list ap); va_list ap);
void outputRaw(const char* sev_text, const std::string& message);
std::string* lookupMessage(const MessageID& id);
/// \brief Output Debug Message /// \brief Output Debug Message
/// ///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment