Skip to content

Commit 14d5a88

Browse files
authored
chore: flip LEGACY_GLOG switch (#575)
Fix CONSOLE_INFO to log to both stdout and the INFO log. Signed-off-by: Roman Gershman <romange@gmail.com>
1 parent 9ced156 commit 14d5a88

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
cat /proc/cpuinfo
9393
cmake -B build \
9494
-DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} \
95-
-GNinja \
95+
-GNinja -DLEGACY_GLOG=OFF \
9696
-DCMAKE_C_COMPILER="${{matrix.config.compiler.c}}" \
9797
-DCMAKE_CXX_COMPILER="${{matrix.config.compiler.cxx}}" \
9898
-DCMAKE_CXX_FLAGS_DEBUG="${{matrix.config.cxx_flags}}" \

base/file_log_sink.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ bool FileLogSink::LogFile::Open(const std::string& base_path, int severity,
147147
string link_path = absl::StrCat(base_path, ".", kSeverityNames[severity]);
148148
string target = path_.substr(path_.rfind('/') + 1);
149149
unlink(link_path.c_str());
150-
symlink(target.c_str(), link_path.c_str());
150+
(void)symlink(target.c_str(), link_path.c_str());
151151
}
152152

153153
return true;

base/logging.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ namespace base {
1717

1818
using std::string;
1919

20-
#ifdef __FreeBSD__
21-
static constexpr char kProcSelf[] = "/proc/curproc/file";
22-
#else
20+
#ifdef __linux__
2321
static constexpr char kProcSelf[] = "/proc/self/exe";
22+
#elif defined(__FreeBSD__)
23+
static constexpr char kProcSelf[] = "/proc/curproc/file";
2424
#endif
2525

2626
static constexpr char kDeletedSuffix[] = " (deleted)";

base/logging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ std::vector<std::string> GetLoggingDirectories();
5959

6060
} // namespace base
6161

62-
#define CONSOLE_INFO ABSL_LOG(INFO).ToSinkOnly(base::ConsoleLogSink::instance())
62+
#define CONSOLE_INFO ABSL_LOG(INFO).ToSinkAlso(base::ConsoleLogSink::instance())
6363

6464
#else
6565
#include <glog/logging.h>

examples/https_client_cli.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// the headers and the body from the host and resource you gave.
1313
// for example:
1414
// ./https_client --host redis.io --resource /commands/asking/ --vmodule=https_client=2
15-
// --logbuflevel=-1 --alsologtostderr
15+
// --logbuflevel=-1 --stderrthreshold=0
1616
// will print the content from https://redis.io/commands/asking command to the log as well as to the
1717
// terminal
1818
#include <openssl/err.h>
@@ -86,7 +86,7 @@ using OpResult = io::Result<RequestResults, std::string>;
8686

8787
OpResult ConnectAndRead(ProactorBase* proactor, std::string_view host, std::string_view service,
8888
const char* resource, SSL_CTX* ssl_ctx) {
89-
89+
9090
auto list_res = proactor->Await([&] {
9191
TlsClient http_client{proactor};
9292

tests/test_echo_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def start(self, server_args=None, ready_timeout: float = 10.0, port: int | None
7272
if self.proc:
7373
raise RuntimeError("echo_server already running")
7474

75-
args = [str(self.binary), "--alsologtostderr"]
75+
args = [str(self.binary), "--stderrthreshold=0"]
7676
if server_args:
7777
args.extend(server_args)
7878

0 commit comments

Comments
 (0)