Switch to Abseil logging.

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>
diff --git a/BUILD.bazel b/BUILD.bazel
index a166476..dcb0969 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -42,7 +42,6 @@
         "re2/unicode_groups.cc",
         "re2/unicode_groups.h",
         "re2/walker-inl.h",
-        "util/logging.h",
         "util/rune.cc",
         "util/strutil.cc",
         "util/strutil.h",
@@ -84,6 +83,8 @@
         "@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",
@@ -125,7 +126,6 @@
         "re2/unicode_casefold.h",
         "re2/unicode_groups.h",
         "re2/walker-inl.h",
-        "util/logging.h",
         "util/strutil.h",
         "util/utf.h",
     ],
@@ -135,6 +135,8 @@
         "@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",
@@ -161,6 +163,8 @@
     deps = [
         ":testing",
         "@abseil-cpp//absl/base:core_headers",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -174,6 +178,8 @@
         ":re2",
         ":testing",
         "@abseil-cpp//absl/base:core_headers",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -186,6 +192,8 @@
     deps = [
         ":testing",
         "@abseil-cpp//absl/base:core_headers",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -198,6 +206,8 @@
     deps = [
         ":testing",
         "@abseil-cpp//absl/base:core_headers",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -211,6 +221,8 @@
         ":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",
@@ -225,6 +237,8 @@
         ":re2",
         ":testing",
         "@abseil-cpp//absl/base:core_headers",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -238,6 +252,8 @@
         ":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",
@@ -250,6 +266,8 @@
     srcs = ["re2/testing/regexp_test.cc"],
     deps = [
         ":testing",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -262,6 +280,8 @@
     deps = [
         ":testing",
         "@abseil-cpp//absl/base:core_headers",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -286,6 +306,8 @@
     deps = [
         ":re2",
         ":testing",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -298,6 +320,8 @@
     deps = [
         ":testing",
         "@abseil-cpp//absl/base:core_headers",
+        "@abseil-cpp//absl/log",
+        "@abseil-cpp//absl/log:check",
         "@googletest//:gtest",
         "@googletest//:gtest_main",
     ],
@@ -323,6 +347,8 @@
         ":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",
@@ -395,6 +421,8 @@
         ":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",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bdac5af..36e7e71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,12 +61,14 @@
 
 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
diff --git a/Makefile b/Makefile
index 5d6d6c0..51a1034 100644
--- a/Makefile
+++ b/Makefile
@@ -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\
@@ -113,7 +115,6 @@
 	re2/stringpiece.h\
 
 HFILES=\
-	util/logging.h\
 	util/malloc_counter.h\
 	util/pcre.h\
 	util/strutil.h\
diff --git a/re2/bitmap256.cc b/re2/bitmap256.cc
index f6fbca3..e455fde 100644
--- a/re2/bitmap256.cc
+++ b/re2/bitmap256.cc
@@ -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 {
 
diff --git a/re2/bitmap256.h b/re2/bitmap256.h
index 293b31d..29e2984 100644
--- a/re2/bitmap256.h
+++ b/re2/bitmap256.h
@@ -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 {
 
diff --git a/re2/bitstate.cc b/re2/bitstate.cc
index 38a0b87..cac8aa0 100644
--- a/re2/bitstate.cc
+++ b/re2/bitstate.cc
@@ -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"
diff --git a/re2/compile.cc b/re2/compile.cc
index aa79887..17e3148 100644
--- a/re2/compile.cc
+++ b/re2/compile.cc
@@ -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"
diff --git a/re2/dfa.cc b/re2/dfa.cc
index e35fcb2..9b8a437 100644
--- a/re2/dfa.cc
+++ b/re2/dfa.cc
@@ -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"
diff --git a/re2/filtered_re2.cc b/re2/filtered_re2.cc
index 1ce26a3..1ef6758 100644
--- a/re2/filtered_re2.cc
+++ b/re2/filtered_re2.cc
@@ -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"
 
diff --git a/re2/mimics_pcre.cc b/re2/mimics_pcre.cc
index ac0c69d..1e4d0d7 100644
--- a/re2/mimics_pcre.cc
+++ b/re2/mimics_pcre.cc
@@ -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"
 
diff --git a/re2/nfa.cc b/re2/nfa.cc
index a655884..3ef8287 100644
--- a/re2/nfa.cc
+++ b/re2/nfa.cc
@@ -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"
diff --git a/re2/onepass.cc b/re2/onepass.cc
index 7931cf9..9831cc8 100644
--- a/re2/onepass.cc
+++ b/re2/onepass.cc
@@ -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"
diff --git a/re2/parse.cc b/re2/parse.cc
index 2558b2a..003b14c 100644
--- a/re2/parse.cc
+++ b/re2/parse.cc
@@ -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"
diff --git a/re2/prefilter.cc b/re2/prefilter.cc
index 3c7886f..53290b0 100644
--- a/re2/prefilter.cc
+++ b/re2/prefilter.cc
@@ -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"
diff --git a/re2/prefilter.h b/re2/prefilter.h
index 018691d..cf32bd6 100644
--- a/re2/prefilter.h
+++ b/re2/prefilter.h
@@ -13,7 +13,8 @@
 #include <string>
 #include <vector>
 
-#include "util/logging.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 
 namespace re2 {
 
diff --git a/re2/prefilter_tree.cc b/re2/prefilter_tree.cc
index 299a680..b7a7408 100644
--- a/re2/prefilter_tree.cc
+++ b/re2/prefilter_tree.cc
@@ -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"
 
diff --git a/re2/prefilter_tree.h b/re2/prefilter_tree.h
index 71e7a29..ba23282 100644
--- a/re2/prefilter_tree.h
+++ b/re2/prefilter_tree.h
@@ -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 {
 
diff --git a/re2/prog.cc b/re2/prog.cc
index 6cadcfa..423e176 100644
--- a/re2/prog.cc
+++ b/re2/prog.cc
@@ -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 {
diff --git a/re2/prog.h b/re2/prog.h
index 41923f3..5db21c4 100644
--- a/re2/prog.h
+++ b/re2/prog.h
@@ -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"
diff --git a/re2/re2.cc b/re2/re2.cc
index 61d9d1f..332157e 100644
--- a/re2/re2.cc
+++ b/re2/re2.cc
@@ -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"
diff --git a/re2/regexp.cc b/re2/regexp.cc
index 4ea81cf..f374c15 100644
--- a/re2/regexp.cc
+++ b/re2/regexp.cc
@@ -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"
diff --git a/re2/regexp.h b/re2/regexp.h
index df49894..9c05cc8 100644
--- a/re2/regexp.h
+++ b/re2/regexp.h
@@ -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 {
diff --git a/re2/set.cc b/re2/set.cc
index b9c918e..4f26907 100644
--- a/re2/set.cc
+++ b/re2/set.cc
@@ -9,7 +9,8 @@
 #include <memory>
 #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/re2.h"
diff --git a/re2/simplify.cc b/re2/simplify.cc
index cea100b..0696612 100644
--- a/re2/simplify.cc
+++ b/re2/simplify.cc
@@ -9,7 +9,8 @@
 #include <algorithm>
 #include <string>
 
-#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/regexp.h"
diff --git a/re2/testing/backtrack.cc b/re2/testing/backtrack.cc
index 90071bb..2ea98e8 100644
--- a/re2/testing/backtrack.cc
+++ b/re2/testing/backtrack.cc
@@ -28,7 +28,8 @@
 #include <string.h>
 
 #include "absl/base/macros.h"
-#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"
diff --git a/re2/testing/compile_test.cc b/re2/testing/compile_test.cc
index f6899d3..532f896 100644
--- a/re2/testing/compile_test.cc
+++ b/re2/testing/compile_test.cc
@@ -7,8 +7,9 @@
 #include <string>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/regexp.h"
 #include "re2/prog.h"
 
diff --git a/re2/testing/dfa_test.cc b/re2/testing/dfa_test.cc
index b0759f7..aa95465 100644
--- a/re2/testing/dfa_test.cc
+++ b/re2/testing/dfa_test.cc
@@ -9,9 +9,10 @@
 
 #include "absl/base/macros.h"
 #include "absl/flags/flag.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/str_format.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "util/malloc_counter.h"
 #include "re2/prog.h"
 #include "re2/re2.h"
diff --git a/re2/testing/dump.cc b/re2/testing/dump.cc
index 9e3c94a..074c6a2 100644
--- a/re2/testing/dump.cc
+++ b/re2/testing/dump.cc
@@ -19,9 +19,10 @@
 #include <string>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/str_format.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "util/utf.h"
 #include "re2/regexp.h"
 
diff --git a/re2/testing/exhaustive_tester.cc b/re2/testing/exhaustive_tester.cc
index a57f700..4d1ff0f 100644
--- a/re2/testing/exhaustive_tester.cc
+++ b/re2/testing/exhaustive_tester.cc
@@ -15,9 +15,10 @@
 
 #include "absl/base/macros.h"
 #include "absl/flags/flag.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/str_format.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/testing/exhaustive_tester.h"
 #include "re2/testing/tester.h"
 
diff --git a/re2/testing/filtered_re2_test.cc b/re2/testing/filtered_re2_test.cc
index a8d2dfc..aea311b 100644
--- a/re2/testing/filtered_re2_test.cc
+++ b/re2/testing/filtered_re2_test.cc
@@ -10,8 +10,9 @@
 #include <utility>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/filtered_re2.h"
 #include "re2/re2.h"
 
diff --git a/re2/testing/mimics_pcre_test.cc b/re2/testing/mimics_pcre_test.cc
index 829659d..d12e511 100644
--- a/re2/testing/mimics_pcre_test.cc
+++ b/re2/testing/mimics_pcre_test.cc
@@ -3,8 +3,9 @@
 // license that can be found in the LICENSE file.
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/prog.h"
 #include "re2/regexp.h"
 
diff --git a/re2/testing/null_walker.cc b/re2/testing/null_walker.cc
index 745364b..4e64f82 100644
--- a/re2/testing/null_walker.cc
+++ b/re2/testing/null_walker.cc
@@ -2,8 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/regexp.h"
 #include "re2/walker-inl.h"
 
diff --git a/re2/testing/parse_test.cc b/re2/testing/parse_test.cc
index 95294d5..3507200 100644
--- a/re2/testing/parse_test.cc
+++ b/re2/testing/parse_test.cc
@@ -7,8 +7,9 @@
 #include <string>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/regexp.h"
 
 namespace re2 {
diff --git a/re2/testing/possible_match_test.cc b/re2/testing/possible_match_test.cc
index fe199c6..16e169d 100644
--- a/re2/testing/possible_match_test.cc
+++ b/re2/testing/possible_match_test.cc
@@ -7,9 +7,10 @@
 #include <vector>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/escaping.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/prog.h"
 #include "re2/re2.h"
 #include "re2/regexp.h"
diff --git a/re2/testing/re2_arg_test.cc b/re2/testing/re2_arg_test.cc
index 78d4aee..a9b044d 100644
--- a/re2/testing/re2_arg_test.cc
+++ b/re2/testing/re2_arg_test.cc
@@ -11,8 +11,9 @@
 #include <string.h>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/re2.h"
 
 namespace re2 {
diff --git a/re2/testing/re2_test.cc b/re2/testing/re2_test.cc
index ddf8dbf..95bf461 100644
--- a/re2/testing/re2_test.cc
+++ b/re2/testing/re2_test.cc
@@ -19,9 +19,10 @@
 #endif
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/str_format.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/re2.h"
 #include "re2/regexp.h"
 
diff --git a/re2/testing/regexp_benchmark.cc b/re2/testing/regexp_benchmark.cc
index 5352b31..3192895 100644
--- a/re2/testing/regexp_benchmark.cc
+++ b/re2/testing/regexp_benchmark.cc
@@ -13,10 +13,11 @@
 
 #include "absl/container/flat_hash_map.h"
 #include "absl/flags/flag.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/str_format.h"
 #include "absl/synchronization/mutex.h"
 #include "benchmark/benchmark.h"
-#include "util/logging.h"
 #include "util/malloc_counter.h"
 #include "re2/prog.h"
 #include "re2/re2.h"
diff --git a/re2/testing/regexp_generator.cc b/re2/testing/regexp_generator.cc
index b1761ed..4d9346f 100644
--- a/re2/testing/regexp_generator.cc
+++ b/re2/testing/regexp_generator.cc
@@ -30,10 +30,11 @@
 #include <vector>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/escaping.h"
 #include "absl/strings/str_format.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "util/utf.h"
 #include "re2/testing/regexp_generator.h"
 
diff --git a/re2/testing/regexp_test.cc b/re2/testing/regexp_test.cc
index ef8f59d..54aa8ad 100644
--- a/re2/testing/regexp_test.cc
+++ b/re2/testing/regexp_test.cc
@@ -9,8 +9,9 @@
 #include <string>
 #include <vector>
 
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/regexp.h"
 
 namespace re2 {
diff --git a/re2/testing/required_prefix_test.cc b/re2/testing/required_prefix_test.cc
index 231fd34..83e2c3e 100644
--- a/re2/testing/required_prefix_test.cc
+++ b/re2/testing/required_prefix_test.cc
@@ -5,8 +5,9 @@
 #include <string>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/prog.h"
 #include "re2/regexp.h"
 
diff --git a/re2/testing/set_test.cc b/re2/testing/set_test.cc
index fdbc0b2..abd0fa4 100644
--- a/re2/testing/set_test.cc
+++ b/re2/testing/set_test.cc
@@ -7,8 +7,9 @@
 #include <vector>
 #include <utility>
 
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/re2.h"
 #include "re2/set.h"
 
diff --git a/re2/testing/simplify_test.cc b/re2/testing/simplify_test.cc
index 5b683f5..4a182d1 100644
--- a/re2/testing/simplify_test.cc
+++ b/re2/testing/simplify_test.cc
@@ -8,8 +8,9 @@
 #include <string>
 
 #include "absl/base/macros.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/regexp.h"
 
 namespace re2 {
diff --git a/re2/testing/string_generator.cc b/re2/testing/string_generator.cc
index 1891b14..90ec46f 100644
--- a/re2/testing/string_generator.cc
+++ b/re2/testing/string_generator.cc
@@ -11,8 +11,9 @@
 #include <string>
 #include <vector>
 
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "gtest/gtest.h"
-#include "util/logging.h"
 #include "re2/testing/string_generator.h"
 
 namespace re2 {
diff --git a/re2/testing/tester.cc b/re2/testing/tester.cc
index a094cb4..e0161be 100644
--- a/re2/testing/tester.cc
+++ b/re2/testing/tester.cc
@@ -11,9 +11,10 @@
 
 #include "absl/base/macros.h"
 #include "absl/flags/flag.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/escaping.h"
 #include "absl/strings/str_format.h"
-#include "util/logging.h"
 #include "re2/testing/tester.h"
 #include "re2/prog.h"
 #include "re2/re2.h"
diff --git a/re2/tostring.cc b/re2/tostring.cc
index 33179fd..e1e870b 100644
--- a/re2/tostring.cc
+++ b/re2/tostring.cc
@@ -8,8 +8,9 @@
 #include <string.h>
 #include <string>
 
+#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/regexp.h"
 #include "re2/walker-inl.h"
diff --git a/re2/walker-inl.h b/re2/walker-inl.h
index 45763a7..fe0dc8c 100644
--- a/re2/walker-inl.h
+++ b/re2/walker-inl.h
@@ -16,7 +16,8 @@
 #include <stack>
 
 #include "absl/base/macros.h"
-#include "util/logging.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "re2/regexp.h"
 
 namespace re2 {
diff --git a/util/logging.h b/util/logging.h
deleted file mode 100644
index 946962b..0000000
--- a/util/logging.h
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2009 The RE2 Authors.  All Rights Reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#ifndef UTIL_LOGGING_H_
-#define UTIL_LOGGING_H_
-
-// Simplified version of Google's logging.
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ostream>
-#include <sstream>
-
-#include "absl/base/attributes.h"
-
-// Debug-only checking.
-#define DCHECK(condition) assert(condition)
-#define DCHECK_EQ(val1, val2) assert((val1) == (val2))
-#define DCHECK_NE(val1, val2) assert((val1) != (val2))
-#define DCHECK_LE(val1, val2) assert((val1) <= (val2))
-#define DCHECK_LT(val1, val2) assert((val1) < (val2))
-#define DCHECK_GE(val1, val2) assert((val1) >= (val2))
-#define DCHECK_GT(val1, val2) assert((val1) > (val2))
-
-// Always-on checking
-#define CHECK(x)	if(x){}else LogMessageFatal(__FILE__, __LINE__).stream() << "Check failed: " #x
-#define CHECK_LT(x, y)	CHECK((x) < (y))
-#define CHECK_GT(x, y)	CHECK((x) > (y))
-#define CHECK_LE(x, y)	CHECK((x) <= (y))
-#define CHECK_GE(x, y)	CHECK((x) >= (y))
-#define CHECK_EQ(x, y)	CHECK((x) == (y))
-#define CHECK_NE(x, y)	CHECK((x) != (y))
-
-#define LOG_INFO LogMessage(__FILE__, __LINE__)
-#define LOG_WARNING LogMessage(__FILE__, __LINE__)
-#define LOG_ERROR LogMessage(__FILE__, __LINE__)
-#define LOG_FATAL LogMessageFatal(__FILE__, __LINE__)
-#define LOG_QFATAL LOG_FATAL
-
-// It seems that one of the Windows header files defines ERROR as 0.
-#ifdef _WIN32
-#define LOG_0 LOG_INFO
-#endif
-
-#ifdef NDEBUG
-#define LOG_DFATAL LOG_ERROR
-#else
-#define LOG_DFATAL LOG_FATAL
-#endif
-
-#define LOG(severity) LOG_ ## severity.stream()
-
-#define VLOG(x) if((x)>0){}else LOG_INFO.stream()
-
-class LogMessage {
- public:
-  LogMessage(const char* file, int line)
-      : flushed_(false) {
-    stream() << file << ":" << line << ": ";
-  }
-  void Flush() {
-    stream() << "\n";
-    std::string s = str_.str();
-    size_t n = s.size();
-    if (fwrite(s.data(), 1, n, stderr) < n) {}  // shut up gcc
-    flushed_ = true;
-  }
-  ~LogMessage() {
-    if (!flushed_) {
-      Flush();
-    }
-  }
-  std::ostream& stream() { return str_; }
-
- private:
-  bool flushed_;
-  std::ostringstream str_;
-
-  LogMessage(const LogMessage&) = delete;
-  LogMessage& operator=(const LogMessage&) = delete;
-};
-
-// Silence "destructor never returns" warning for ~LogMessageFatal().
-// Since this is a header file, push and then pop to limit the scope.
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable: 4722)
-#endif
-
-class LogMessageFatal : public LogMessage {
- public:
-  LogMessageFatal(const char* file, int line)
-      : LogMessage(file, line) {}
-  ABSL_ATTRIBUTE_NORETURN ~LogMessageFatal() {
-    Flush();
-    abort();
-  }
- private:
-  LogMessageFatal(const LogMessageFatal&) = delete;
-  LogMessageFatal& operator=(const LogMessageFatal&) = delete;
-};
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#endif  // UTIL_LOGGING_H_
diff --git a/util/pcre.cc b/util/pcre.cc
index 27aee3d..71e5329 100644
--- a/util/pcre.cc
+++ b/util/pcre.cc
@@ -16,8 +16,9 @@
 #include <utility>
 
 #include "absl/flags/flag.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
 #include "absl/strings/str_format.h"
-#include "util/logging.h"
 #include "util/pcre.h"
 
 // Silence warnings about the wacky formatting in the operator() functions.