aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/logging.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-03-02 15:57:31 +0100
committerGitHub <noreply@github.com>2023-03-02 15:57:31 +0100
commitb9370fd7a040558cc8c7d5db109fdd3e407ff409 (patch)
tree4f9b64ba19120271c2ef1e2ecc3b104beb36770a /src/libutil/logging.cc
parent85dbf9de8e30d07139d983ee4066332c477ee0f9 (diff)
parentb69a73a2305aaee2a4da73da601dbde3f1ddd7a6 (diff)
Merge pull request #7941 from edolstra/stdout
Check writes to stdout
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r--src/libutil/logging.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 904ba6ebe..56bdaf87a 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -32,7 +32,8 @@ void Logger::warn(const std::string & msg)
void Logger::writeToStdout(std::string_view s)
{
- std::cout << s << "\n";
+ writeFull(STDOUT_FILENO, s);
+ writeFull(STDOUT_FILENO, "\n");
}
class SimpleLogger : public Logger
@@ -84,7 +85,7 @@ public:
void startActivity(ActivityId act, Verbosity lvl, ActivityType type,
const std::string & s, const Fields & fields, ActivityId parent)
- override
+ override
{
if (lvl <= verbosity && !s.empty())
log(lvl, s + "...");