Skip to content
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

Update absl. This brings us VLOG #2088

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ http_archive(
patches = [
"//bazel:absl.patch",
],
sha256 = "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed",
strip_prefix = "abseil-cpp-20230802.1",
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.tar.gz"],
sha256 = "338420448b140f0dfd1a1ea3c3ce71b3bc172071f24f4d9a57d59b45037da440",
strip_prefix = "abseil-cpp-20240116.0",
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.0.tar.gz"],
)

http_archive(
Expand Down Expand Up @@ -139,10 +139,10 @@ bison_register_toolchains()

http_archive(
name = "com_google_protobuf",
sha256 = "9bd87b8280ef720d3240514f884e56a712f2218f0d693b48050c836028940a42",
strip_prefix = "protobuf-25.1",
sha256 = "8ff511a64fc46ee792d3fe49a5a1bcad6f7dc50dfbba5a28b0e5b979c17f9871",
strip_prefix = "protobuf-25.2",
urls = [
"https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protobuf-25.1.tar.gz",
"https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protobuf-25.2.tar.gz",
],
)

Expand Down
6 changes: 2 additions & 4 deletions common/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,16 @@ cc_library(
hdrs = ["init_command_line.h"],
deps = [
# these deps are needed by init_command_line.cc:
":logging", # buildcleaner: keep
":build-version", # buildcleaner: keep
"@com_google_absl//absl/debugging:failure_signal_handler", # buildcleaner: keep
"@com_google_absl//absl/debugging:symbolize", # buildcleaner: keep
"@com_google_absl//absl/flags:config", # buildcleaner: keep
"@com_google_absl//absl/flags:flag", # buildcleaner: keep
"@com_google_absl//absl/flags:parse", # buildcleaner: keep
"@com_google_absl//absl/flags:usage", # buildcleaner: keep
"@com_google_absl//absl/log:globals", # buildcleaner: keep
"@com_google_absl//absl/log:globals",
"@com_google_absl//absl/log:initialize", # buildcleaner: keep
"@com_google_absl//absl/strings", # buildcleaner: keep
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time", # buildcleaner: keep
],
)
Expand Down Expand Up @@ -153,7 +152,6 @@ cc_library(
# this common/util:logging target.
cc_library(
name = "logging",
srcs = ["logging.cc"],
hdrs = ["logging.h"],
deps = [
"@com_google_absl//absl/log",
Expand Down
5 changes: 1 addition & 4 deletions common/util/init_command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "absl/strings/numbers.h"
#include "absl/time/time.h"
#include "common/util/generated_verible_build_version.h"
#include "common/util/logging.h"

namespace verible {

Expand Down Expand Up @@ -78,9 +77,7 @@ void SetLoggingLevelsFromEnvironment() {
const char *const vlog_level_env = getenv("VERIBLE_VLOG_DETAIL");
int vlog_level = 0;
if (vlog_level_env && absl::SimpleAtoi(vlog_level_env, &vlog_level)) {
VERIBLE_INTERNAL_SET_VLOGLEVEL(vlog_level);
} else {
VERIBLE_INTERNAL_SET_VLOGLEVEL(0);
absl::SetGlobalVLogLevel(vlog_level);
}
}

Expand Down
18 changes: 0 additions & 18 deletions common/util/logging.cc

This file was deleted.

25 changes: 0 additions & 25 deletions common/util/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,6 @@
#include "absl/log/die_if_null.h"
#include "absl/log/log.h"

// The VLOG level is set from the VERILOG_VLOG_DETAIL environment variable in
// InitCommandLine(), which calls the VERIBLE_INTERNAL_SET_VLOGLEVEL() macro.
#if defined(VLOG) && defined(ABSL_VLOG_IS_ON)
// If there is an ABSL implementation of VLOG, use that.
#define VERIBLE_INTERNAL_SET_VLOGLEVEL(level) absl::SetGlobalVLogLevel(level)
#else
// ... otherwise provide a minimal local implementation.
namespace verible {
// Used in the VLOG macro to check logging condition.
extern int global_vlog_level_;
} // namespace verible

#define VERIBLE_INTERNAL_SET_VLOGLEVEL(level) \
verible::global_vlog_level_ = level

#define VLOG_IS_ON(x) (::verible::global_vlog_level_ >= (x))
#define VLOG(x) LOG_IF(INFO, VLOG_IS_ON(x))

#ifdef NDEBUG
#define DVLOG(x) LOG_IF(INFO, false)
#else
#define DVLOG(x) VLOG(x)
#endif // NDEBUG
#endif // VLOG

#define CHECK_NOTNULL(p) (void)ABSL_DIE_IF_NULL(p)

#endif // VERIBLE_COMMON_UTIL_LOGGING_H_
Loading