diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-05-14 16:48:20 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-05-15 16:46:45 +0200 |
commit | 0fd32f8b9d707d807c236156de12118b0a695d69 (patch) | |
tree | 08181c9b2d429ab896cee10302630f6972aae64a /src/buildtool/common/remote/retry.hpp | |
parent | 2bcbeb55f45a6c5aa193fab06f301f7231d5f16c (diff) | |
download | justbuild-0fd32f8b9d707d807c236156de12118b0a695d69.tar.gz |
logging: Do not make assumptions in emit calls
The Emit method of the Logger class, when called with a string as
second argument, expects it to be a format string. It should be
considered a programming error to pass a string variable as that
argument without knowing for certain that it does not contain any
format escape character ('{', '}'); instead, one should be
conservative and use the blind format string "{}" as second
argument and pass the unknown string variable as third argument.
Diffstat (limited to 'src/buildtool/common/remote/retry.hpp')
-rw-r--r-- | src/buildtool/common/remote/retry.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildtool/common/remote/retry.hpp b/src/buildtool/common/remote/retry.hpp index 4e1e3492..0f82a48f 100644 --- a/src/buildtool/common/remote/retry.hpp +++ b/src/buildtool/common/remote/retry.hpp @@ -61,7 +61,7 @@ template <CallableReturningRetryResponse F> } if (fatal) { if (error_msg) { - logger.Emit(LogLevel::Error, *error_msg); + logger.Emit(LogLevel::Error, "{}", *error_msg); } return false; } |