Skip to content

Commit edf0ab8

Browse files
committed
Use ABSL_LOG macros over LOG macros
LOG causes macro pollution and conflicts with ProxyWasm SDK (see proxy-wasm/proxy-wasm-cpp-sdk#154). PiperOrigin-RevId: 533164114
1 parent 51bbf36 commit edf0ab8

9 files changed

+20
-21
lines changed

eval/compiler/regex_precompilation_optimization_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace {
3636
using cel::ast::internal::CheckedExpr;
3737
using google::api::expr::parser::Parse;
3838

39-
namespace exprpb = google::api::expr::v1alpha1;
39+
namespace exprpb = google::api::expr;
4040

4141
class RegexPrecompilationExtensionTest : public testing::Test {
4242
public:

eval/internal/BUILD

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ cc_library(
3535
"//internal:status_macros",
3636
"@com_google_absl//absl/base:core_headers",
3737
"@com_google_absl//absl/container:flat_hash_map",
38-
"@com_google_absl//absl/log",
3938
"@com_google_absl//absl/status",
4039
"@com_google_absl//absl/status:statusor",
4140
"@com_google_absl//absl/strings",

eval/internal/interop.cc

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "google/protobuf/arena.h"
2222
#include "absl/base/attributes.h"
2323
#include "absl/container/flat_hash_map.h"
24-
#include "absl/log/log.h"
2524
#include "absl/status/status.h"
2625
#include "absl/strings/str_cat.h"
2726
#include "absl/strings/string_view.h"

eval/public/BUILD

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ cc_library(
8383
"//internal:status_macros",
8484
"//internal:utf8",
8585
"@com_google_absl//absl/base:core_headers",
86-
"@com_google_absl//absl/log",
86+
"@com_google_absl//absl/log:absl_log",
8787
"@com_google_absl//absl/status",
8888
"@com_google_absl//absl/status:statusor",
8989
"@com_google_absl//absl/strings",
@@ -633,7 +633,7 @@ cc_library(
633633
deps = [
634634
":ast_visitor",
635635
":source_position",
636-
"@com_google_absl//absl/log",
636+
"@com_google_absl//absl/log:absl_log",
637637
"@com_google_absl//absl/types:variant",
638638
"@com_google_googleapis//google/api/expr/v1alpha1:syntax_cc_proto",
639639
],
@@ -651,7 +651,7 @@ cc_library(
651651
":ast_visitor_native",
652652
":source_position_native",
653653
"//base:ast_internal",
654-
"@com_google_absl//absl/log",
654+
"@com_google_absl//absl/log:absl_log",
655655
"@com_google_absl//absl/types:variant",
656656
],
657657
)
@@ -835,7 +835,7 @@ cc_library(
835835
deps = [
836836
":ast_visitor",
837837
":source_position",
838-
"@com_google_absl//absl/log",
838+
"@com_google_absl//absl/log:absl_log",
839839
"@com_google_absl//absl/types:span",
840840
"@com_google_absl//absl/types:variant",
841841
"@com_google_googleapis//google/api/expr/v1alpha1:syntax_cc_proto",
@@ -870,7 +870,7 @@ cc_library(
870870
deps = [
871871
":ast_visitor_native",
872872
":source_position_native",
873-
"@com_google_absl//absl/log",
873+
"@com_google_absl//absl/log:absl_log",
874874
"@com_google_absl//absl/types:span",
875875
"@com_google_absl//absl/types:variant",
876876
],

eval/public/ast_rewrite.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <vector>
1919

2020
#include "google/api/expr/v1alpha1/syntax.pb.h"
21-
#include "absl/log/log.h"
21+
#include "absl/log/absl_log.h"
2222
#include "absl/types/variant.h"
2323
#include "eval/public/ast_visitor.h"
2424
#include "eval/public/source_position.h"
@@ -196,7 +196,7 @@ struct PostVisitor {
196196
case Expr::EXPR_KIND_NOT_SET:
197197
break;
198198
default:
199-
LOG(ERROR) << "Unsupported Expr kind: " << expr->expr_kind_case();
199+
ABSL_LOG(ERROR) << "Unsupported Expr kind: " << expr->expr_kind_case();
200200
}
201201

202202
visitor->PostVisitExpr(expr, &position);

eval/public/ast_rewrite_native.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <stack>
1818
#include <vector>
1919

20-
#include "absl/log/log.h"
20+
#include "absl/log/absl_log.h"
2121
#include "absl/types/variant.h"
2222
#include "eval/public/ast_visitor_native.h"
2323
#include "eval/public/source_position_native.h"
@@ -199,7 +199,7 @@ struct PostVisitor {
199199
visitor->PostVisitComprehension(&comprehension, expr, position);
200200
}
201201
void operator()(absl::monostate) {
202-
LOG(ERROR) << "Unsupported Expr kind";
202+
ABSL_LOG(ERROR) << "Unsupported Expr kind";
203203
}
204204
} handler{visitor, record.expr, &position};
205205
absl::visit(handler, record.expr->expr_kind());

eval/public/ast_traverse.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <stack>
1818

1919
#include "google/api/expr/v1alpha1/syntax.pb.h"
20-
#include "absl/log/log.h"
20+
#include "absl/log/absl_log.h"
2121
#include "absl/types/variant.h"
2222
#include "eval/public/ast_visitor.h"
2323
#include "eval/public/source_position.h"
@@ -197,7 +197,7 @@ struct PostVisitor {
197197
&position);
198198
break;
199199
default:
200-
LOG(ERROR) << "Unsupported Expr kind: " << expr->expr_kind_case();
200+
ABSL_LOG(ERROR) << "Unsupported Expr kind: " << expr->expr_kind_case();
201201
}
202202

203203
visitor->PostVisitExpr(expr, &position);

eval/public/ast_traverse_native.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <stack>
1818

19-
#include "absl/log/log.h"
19+
#include "absl/log/absl_log.h"
2020
#include "absl/types/variant.h"
2121
#include "base/ast_internal.h"
2222
#include "eval/public/ast_visitor_native.h"
@@ -174,7 +174,7 @@ struct PostVisitor {
174174
&position);
175175
}
176176
void operator()(absl::monostate) {
177-
LOG(ERROR) << "Unsupported Expr kind";
177+
ABSL_LOG(ERROR) << "Unsupported Expr kind";
178178
}
179179
} handler{visitor, record.expr,
180180
SourcePosition(expr->id(), record.source_info)};

eval/public/cel_value.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "absl/base/attributes.h"
2626
#include "absl/base/macros.h"
2727
#include "absl/base/optimization.h"
28-
#include "absl/log/log.h"
28+
#include "absl/log/absl_log.h"
2929
#include "absl/status/status.h"
3030
#include "absl/status/statusor.h"
3131
#include "absl/strings/str_cat.h"
@@ -489,7 +489,8 @@ class CelValue {
489489

490490
// Crashes with a null pointer error.
491491
static void CrashNullPointer(Type type) ABSL_ATTRIBUTE_COLD {
492-
LOG(FATAL) << "Null pointer supplied for " << TypeName(type); // Crash ok
492+
ABSL_LOG(FATAL) << "Null pointer supplied for "
493+
<< TypeName(type); // Crash ok
493494
}
494495

495496
// Null pointer checker for pointer-based types.
@@ -502,9 +503,9 @@ class CelValue {
502503
// Crashes with a type mismatch error.
503504
static void CrashTypeMismatch(Type requested_type,
504505
Type actual_type) ABSL_ATTRIBUTE_COLD {
505-
LOG(FATAL) << "Type mismatch" // Crash ok
506-
<< ": expected " << TypeName(requested_type) // Crash ok
507-
<< ", encountered " << TypeName(actual_type); // Crash ok
506+
ABSL_LOG(FATAL) << "Type mismatch" // Crash ok
507+
<< ": expected " << TypeName(requested_type) // Crash ok
508+
<< ", encountered " << TypeName(actual_type); // Crash ok
508509
}
509510

510511
// Gets value of type specified

0 commit comments

Comments
 (0)