From 780d8d8c775b40b67eb545619689d26ffe65a622 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Thu, 23 Dec 2021 23:26:50 +0100 Subject: [PATCH] Use std::cerr instead of std::clog --- elisp/binary.cc | 2 +- elisp/emacs.cc | 2 +- elisp/process.cc | 16 ++++++++-------- elisp/test.cc | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/elisp/binary.cc b/elisp/binary.cc index fed09ca9..5bd05047 100644 --- a/elisp/binary.cc +++ b/elisp/binary.cc @@ -44,7 +44,7 @@ int RunBinary(const NativeString& argv0, const std::vector& args) { const absl::StatusOr status_or_code = RunBinaryImpl(argv0, args); if (!status_or_code.ok()) { - std::clog << status_or_code.status() << std::endl; + std::cerr << status_or_code.status() << std::endl; return EXIT_FAILURE; } return status_or_code.value(); diff --git a/elisp/emacs.cc b/elisp/emacs.cc index 70c122f0..d114bfa8 100644 --- a/elisp/emacs.cc +++ b/elisp/emacs.cc @@ -43,7 +43,7 @@ static absl::StatusOr RunEmacsImpl(const NativeString& argv0, int RunEmacs(const NativeString& argv0, const std::vector& args) { const absl::StatusOr status_or_code = RunEmacsImpl(argv0, args); if (!status_or_code.ok()) { - std::clog << status_or_code.status() << std::endl; + std::cerr << status_or_code.status() << std::endl; return EXIT_FAILURE; } return status_or_code.value(); diff --git a/elisp/process.cc b/elisp/process.cc index 9947c0be..0295b578 100644 --- a/elisp/process.cc +++ b/elisp/process.cc @@ -130,7 +130,7 @@ static std::wstring BuildEnvironmentBlock( std::wstring result; for (const std::wstring& var : vars) { if (var.find(L'\0') != var.npos) { - std::wclog << L"Environment variable " << var + std::wcerr << L"Environment variable " << var << L" contains a null character" << std::endl; std::abort(); } @@ -142,11 +142,11 @@ static std::wstring BuildEnvironmentBlock( } static wchar_t* Pointer(std::wstring& string) { if (string.empty()) { - std::wclog << L"empty string" << std::endl; + std::wcerr << L"empty string" << std::endl; std::abort(); } if (string.find('\0') != string.npos) { - std::wclog << string << L" contains null character" << std::endl; + std::wcerr << string << L" contains null character" << std::endl; std::abort(); } return &string.front(); @@ -156,11 +156,11 @@ static std::vector Pointers(std::vector& strings) { std::vector ptrs; for (std::string& s : strings) { if (s.empty()) { - std::clog << "empty string" << std::endl; + std::cerr << "empty string" << std::endl; std::abort(); } if (s.find('\0') != s.npos) { - std::clog << s << " contains null character" << std::endl; + std::cerr << s << " contains null character" << std::endl; std::abort(); } ptrs.push_back(&s.front()); @@ -179,7 +179,7 @@ static Environment CopyEnv() { const std::unique_ptr envp(::GetEnvironmentStringsW()); if (envp == nullptr) { // This cannot really happen in practice. - std::wclog << L"GetEnvironmentStringsW failed" << std::endl; + std::wcerr << L"GetEnvironmentStringsW failed" << std::endl; std::abort(); } const wchar_t* p = envp.get(); @@ -190,7 +190,7 @@ static Environment CopyEnv() { // Their names start with an equals sign. const wchar_t* const q = std::wcschr(p + 1, L'='); if (q == nullptr) { - std::wclog << "Invalid environment block entry " << p << std::endl; + std::wcerr << "Invalid environment block entry " << p << std::endl; std::abort(); } map.emplace(std::wstring(p, q), std::wstring(q + 1)); @@ -198,7 +198,7 @@ static Environment CopyEnv() { if (p == nullptr) { // This can’t happen because the environment block is terminated by a // double null character. - std::wclog + std::wcerr << L"GetEnvironmentStringsW returned an invalid environment block" << std::endl; std::abort(); diff --git a/elisp/test.cc b/elisp/test.cc index 5aa62a48..4217ab28 100644 --- a/elisp/test.cc +++ b/elisp/test.cc @@ -44,7 +44,7 @@ static absl::StatusOr RunTestImpl(const std::vector& args) { int RunTest(const std::vector& args) { const absl::StatusOr status_or_code = RunTestImpl(args); if (!status_or_code.ok()) { - std::clog << status_or_code.status() << std::endl; + std::cerr << status_or_code.status() << std::endl; return EXIT_FAILURE; } return status_or_code.value();