Skip to content

Commit

Permalink
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
Browse files Browse the repository at this point in the history
…SERT (grpc#36445)

[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

These changes have been made using string replacement and regex.

Will not be replacing all instances of CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only ones which are doable using very simple regex with least chance of failure will be replaced.

Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#36445

COPYBARA_INTEGRATE_REVIEW=grpc#36445 from tanvi-jagtap:tjagtap_assert_tools c160ab2
PiperOrigin-RevId: 628093687
  • Loading branch information
tanvi-jagtap authored and copybara-github committed Apr 25, 2024
1 parent e640ac6 commit c8f85ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tools/codegen/core/gen_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
% endfor
}
JoinState(const JoinState& other) {
GPR_ASSERT(other.ready.none());
CHECK(other.ready.none());
% for i in range(0,n):
Construct(&promise${i}, other.promise${i});
% endfor
Expand Down Expand Up @@ -108,6 +108,8 @@
#include <grpc/support/port_platform.h>
#include "absl/log/check.h"
#include "src/core/lib/gprpp/construct_destruct.h"
#include "src/core/lib/promise/detail/promise_like.h"
#include "src/core/lib/promise/poll.h"
Expand Down
3 changes: 2 additions & 1 deletion tools/codegen/core/gen_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
% endfor
}
SeqState(const SeqState& other) noexcept : state(other.state), whence(other.whence) {
GPR_ASSERT(state == State::kState0);
CHECK(state == State::kState0);
Construct(&${"prior."*(n-1-i)}current_promise,
other.${"prior."*(n-1-i)}current_promise);
% for i in range(0,n-1):
Expand Down Expand Up @@ -197,6 +197,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/base/attributes.h"
#include "absl/strings/str_cat.h"
Expand Down

0 comments on commit c8f85ff

Please sign in to comment.