Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
121d3e84
Commit
121d3e84
authored
May 05, 2011
by
Michal 'vorner' Vaner
Browse files
[trac901] The impl can output and lookup message
parent
c3dad479
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/log/logger_impl.cc
View file @
121d3e84
...
...
@@ -194,6 +194,26 @@ LoggerImpl::isDebugEnabled(int dbglevel) {
}
// 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
LoggerImpl
::
output
(
const
char
*
sev_text
,
const
MessageID
&
ident
,
...
...
src/lib/log/logger_impl.h
View file @
121d3e84
...
...
@@ -179,6 +179,8 @@ public:
void
output
(
const
char
*
sev_text
,
const
MessageID
&
ident
,
va_list
ap
);
void
outputRaw
(
const
char
*
sev_text
,
const
std
::
string
&
message
);
std
::
string
*
lookupMessage
(
const
MessageID
&
id
);
/// \brief Output Debug Message
///
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment