Skip to content
GitLab
Menu
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
9187be72
Unverified
Commit
9187be72
authored
May 06, 2022
by
Andrei Pavel
🐧
Browse files
[
#562
] mention mark and argument in logger error
parent
7e47dc28
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/log/log_formatter.cc
View file @
9187be72
...
...
@@ -29,19 +29,17 @@ replacePlaceholder(std::string& message, const string& arg,
message
.
replace
(
pos
,
mark
.
size
(),
arg
);
pos
=
message
.
find
(
mark
,
pos
+
arg
.
size
());
}
while
(
pos
!=
string
::
npos
);
}
}
else
{
#ifdef ENABLE_LOGGER_CHECKS
else
{
// We're missing the placeholder, so throw an exception
isc_throw
(
MismatchedPlaceholders
,
"Missing logger placeholder in message: "
<<
message
);
}
isc_throw
(
MismatchedPlaceholders
,
"Missing logger placeholder '"
<<
mark
<<
"' for value '"
<<
arg
<<
"' in
message
'"
<<
message
<<
"'"
);
#else
else
{
// We're missing the placeholder, so add some complain
message
.
append
(
" @@Missing placeholder "
+
mark
+
" for '"
+
arg
+
"'@@"
);
}
message
.
append
(
" @@Missing placeholder '"
+
mark
+
"' for value '"
+
arg
+
"'@@"
);
#endif
/* ENABLE_LOGGER_CHECKS */
}
}
void
...
...
@@ -57,10 +55,11 @@ checkExcessPlaceholders(std::string& message,
#ifdef ENABLE_LOGGER_CHECKS
// Also, make sure we print the message so we can identify which
// identifier has the problem.
cerr
<<
"Message "
<<
message
<<
endl
;
assert
(
"Excess logger placeholders still exist in message"
==
NULL
);
cerr
<<
"Excess logger placeholder '"
<<
mark
<<
"' still exists in message '"
<<
message
<<
"'."
<<
endl
;
assert
(
false
);
#else
message
.
append
(
" @@Excess logger placeholder
s
still exist@@"
);
message
.
append
(
" @@Excess logger placeholder
"
+
mark
+
"
still exist
s
@@"
);
#endif
/* ENABLE_LOGGER_CHECKS */
}
}
...
...
Andrei Pavel
🐧
@andrei
mentioned in merge request
!1647 (merged)
·
May 20, 2022
mentioned in merge request
!1647 (merged)
mentioned in merge request !1647
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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