New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-7509: Fix two bugs in handling strings with %s #14
Conversation
inspect.stack()[2][3], frame.f_lineno, fmt % args) | ||
msg = fmt % args if args else fmt | ||
self.logMsg(level, os.path.split(frame.f_code.co_filename)[1], | ||
inspect.stack()[2][3], frame.f_lineno, fmt % msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean fmt % msg
here? Not just msg
?
d71ed6b
to
3ec0223
Compare
inspect.stack()[2][3], frame.f_lineno, fmt % args) | ||
msg = fmt % args if args else fmt | ||
self.logMsg(level, os.path.split(frame.f_code.co_filename)[1], | ||
inspect.stack()[2][3], frame.f_lineno, msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indenting doesn't match the open paren.
|
@@ -61,10 +61,10 @@ import os | |||
%include "lsst/log/Log.h" | |||
|
|||
%extend lsst::log::Log { | |||
void log(int level, std::string const& filename, | |||
void logMsg(int level, std::string const& filename, | |||
std::string const& funcname, unsigned int lineno, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indenting.
96bfa03
to
2150abb
Compare
The bugs are: - If one logs a message with a string that contains %s and no format arguments, an exception is raised because % formatting is attempted - If one logs a message with a string that contains %s after formatting with data arguments that are provided the system segfaults because Log.log is called (which attempts formatting) instead of Log.logMsg
Also remove obsolete tests entry from .gitignore
2150abb
to
e6c6b0a
Compare
I fixed the indentation issues noted by @timj |
The bugs are:
and no format arguments, an exception is raised
because % formatting is attempted
after formatting with data arguments that are provided
the system segfaults because Log.log is called
(which attempts formatting) instead of Log.logMsg