Skip to content

Commit

Permalink
Switch to Abseil logging.
Browse files Browse the repository at this point in the history
Fixes #494.

Change-Id: Ie8bd23d44a6f2609b72f115c3b2344a2a91637be
Reviewed-on: https://code-review.googlesource.com/c/re2/+/63091
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
  • Loading branch information
junyer committed May 17, 2024
1 parent b664e41 commit 4f5fd7a
Show file tree
Hide file tree
Showing 48 changed files with 122 additions and 156 deletions.
32 changes: 30 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ cc_library(
"re2/unicode_groups.cc",
"re2/unicode_groups.h",
"re2/walker-inl.h",
"util/logging.h",
"util/rune.cc",
"util/strutil.cc",
"util/strutil.h",
Expand Down Expand Up @@ -84,6 +83,8 @@ cc_library(
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/container:flat_hash_set",
"@abseil-cpp//absl/container:inlined_vector",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@abseil-cpp//absl/synchronization",
Expand Down Expand Up @@ -125,7 +126,6 @@ cc_library(
"re2/unicode_casefold.h",
"re2/unicode_groups.h",
"re2/walker-inl.h",
"util/logging.h",
"util/strutil.h",
"util/utf.h",
],
Expand All @@ -135,6 +135,8 @@ cc_library(
"@abseil-cpp//absl/base",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@googletest//:gtest",
Expand All @@ -161,6 +163,8 @@ cc_test(
deps = [
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -174,6 +178,8 @@ cc_test(
":re2",
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -186,6 +192,8 @@ cc_test(
deps = [
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -198,6 +206,8 @@ cc_test(
deps = [
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -211,6 +221,8 @@ cc_test(
":re2",
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings",
"@googletest//:gtest",
"@googletest//:gtest_main",
Expand All @@ -225,6 +237,8 @@ cc_test(
":re2",
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -238,6 +252,8 @@ cc_test(
":re2",
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings:str_format",
"@googletest//:gtest",
"@googletest//:gtest_main",
Expand All @@ -250,6 +266,8 @@ cc_test(
srcs = ["re2/testing/regexp_test.cc"],
deps = [
":testing",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -262,6 +280,8 @@ cc_test(
deps = [
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -286,6 +306,8 @@ cc_test(
deps = [
":re2",
":testing",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -298,6 +320,8 @@ cc_test(
deps = [
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -323,6 +347,8 @@ cc_test(
":testing",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings:str_format",
"@googletest//:gtest",
"@googletest//:gtest_main",
Expand Down Expand Up @@ -395,6 +421,8 @@ cc_binary(
":testing",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings:str_format",
"@abseil-cpp//absl/synchronization",
"@google_benchmark//:benchmark_main",
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ endif()

set(ABSL_DEPS
absl_base
absl_check
absl_core_headers
absl_fixed_array
absl_flags
absl_flat_hash_map
absl_flat_hash_set
absl_inlined_vector
absl_log
absl_optional
absl_span
absl_str_format
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
# Build against Abseil.
ABSL_DEPS=\
absl_base\
absl_check\
absl_core_headers\
absl_fixed_array\
absl_flags\
absl_flat_hash_map\
absl_flat_hash_set\
absl_inlined_vector\
absl_log\
absl_optional\
absl_span\
absl_str_format\
Expand Down Expand Up @@ -113,7 +115,6 @@ INSTALL_HFILES=\
re2/stringpiece.h\

HFILES=\
util/logging.h\
util/malloc_counter.h\
util/pcre.h\
util/strutil.h\
Expand Down
3 changes: 2 additions & 1 deletion re2/bitmap256.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#include <stdint.h>

#include "absl/base/macros.h"
#include "util/logging.h"
#include "absl/log/check.h"
#include "absl/log/log.h"

namespace re2 {

Expand Down
3 changes: 2 additions & 1 deletion re2/bitmap256.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#include <stdint.h>
#include <string.h>

#include "util/logging.h"
#include "absl/log/check.h"
#include "absl/log/log.h"

namespace re2 {

Expand Down
3 changes: 2 additions & 1 deletion re2/bitstate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#include <limits>
#include <utility>

#include "util/logging.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
#include "re2/regexp.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/compile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

#include "absl/base/macros.h"
#include "absl/container/flat_hash_map.h"
#include "util/logging.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "util/utf.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/dfa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
#include "absl/base/thread_annotations.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "absl/synchronization/mutex.h"
#include "absl/types/span.h"
#include "util/logging.h"
#include "util/strutil.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/filtered_re2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include <string>
#include <utility>

#include "util/logging.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "re2/prefilter.h"
#include "re2/prefilter_tree.h"

Expand Down
3 changes: 2 additions & 1 deletion re2/mimics_pcre.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
//
// Regexp::MimicsPCRE checks for any of these conditions.

#include "util/logging.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "re2/regexp.h"
#include "re2/walker-inl.h"

Expand Down
3 changes: 2 additions & 1 deletion re2/nfa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
#include <utility>
#include <vector>

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "util/logging.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
#include "re2/regexp.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/onepass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@

#include "absl/container/fixed_array.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "util/logging.h"
#include "util/utf.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#include <vector>

#include "absl/base/macros.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/ascii.h"
#include "util/logging.h"
#include "util/utf.h"
#include "re2/pod_array.h"
#include "re2/regexp.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/prefilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#include <utility>
#include <vector>

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "util/logging.h"
#include "util/utf.h"
#include "re2/re2.h"
#include "re2/unicode_casefold.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/prefilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#include <string>
#include <vector>

#include "util/logging.h"
#include "absl/log/check.h"
#include "absl/log/log.h"

namespace re2 {

Expand Down
3 changes: 2 additions & 1 deletion re2/prefilter_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
#include <utility>
#include <vector>

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "util/logging.h"
#include "re2/prefilter.h"
#include "re2/re2.h"

Expand Down
3 changes: 2 additions & 1 deletion re2/prefilter_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#include <vector>

#include "absl/container/flat_hash_set.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "re2/prefilter.h"
#include "re2/sparse_array.h"
#include "util/logging.h"

namespace re2 {

Expand Down
3 changes: 2 additions & 1 deletion re2/prog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#include <utility>

#include "absl/base/macros.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "util/logging.h"
#include "re2/bitmap256.h"

namespace re2 {
Expand Down
3 changes: 2 additions & 1 deletion re2/prog.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
#include <type_traits>

#include "absl/base/call_once.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/string_view.h"
#include "util/logging.h"
#include "re2/pod_array.h"
#include "re2/re2.h"
#include "re2/sparse_array.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/re2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@

#include "absl/base/macros.h"
#include "absl/container/fixed_array.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/ascii.h"
#include "absl/strings/str_format.h"
#include "util/logging.h"
#include "util/strutil.h"
#include "util/utf.h"
#include "re2/prog.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/regexp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#include "absl/base/call_once.h"
#include "absl/base/macros.h"
#include "absl/container/flat_hash_map.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/synchronization/mutex.h"
#include "util/logging.h"
#include "util/utf.h"
#include "re2/pod_array.h"
#include "re2/walker-inl.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/regexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@
#include <set>
#include <string>

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/string_view.h"
#include "util/logging.h"
#include "util/utf.h"

namespace re2 {
Expand Down
Loading

0 comments on commit 4f5fd7a

Please sign in to comment.