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
  • Loading branch information
tanvi-jagtap committed Apr 28, 2024
1 parent 8e6a612 commit c5a75ba
Show file tree
Hide file tree
Showing 36 changed files with 65 additions and 78 deletions.
16 changes: 4 additions & 12 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config.m4

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config.w32

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gRPC-Core.podspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions grpc.gemspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/core/lib/gpr/alloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include <stdlib.h>
#include <string.h>

#include <grpc/support/alloc.h>
#include "absl/log/check.h"
#include "absl/log/check.h"

#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

#include "src/core/lib/gprpp/crash.h"
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/gpr/posix/sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include <errno.h>
#include <time.h>

#include <grpc/support/alloc.h>
#include "absl/log/check.h"
#include "absl/log/check.h"

#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
Expand Down
17 changes: 8 additions & 9 deletions src/core/lib/gpr/posix/time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#ifdef __linux__
#include <sys/syscall.h>
#endif
#include <grpc/support/atm.h>
#include "absl/log/check.h"
#include "absl/log/check.h"

#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>

Expand All @@ -40,8 +40,8 @@ static struct timespec timespec_from_gpr(gpr_timespec gts) {
struct timespec rv;
if (sizeof(time_t) < sizeof(int64_t)) {
// fine to assert, as this is only used in gpr_sleep_until
CHECK(gts.tv_sec <= INT32_MAX );
CHECK( gts.tv_sec >= INT32_MIN);
CHECK(gts.tv_sec <= INT32_MAX);
CHECK(gts.tv_sec >= INT32_MIN);
}
rv.tv_sec = static_cast<time_t>(gts.tv_sec);
rv.tv_nsec = gts.tv_nsec;
Expand Down Expand Up @@ -90,13 +90,12 @@ gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl;

gpr_timespec gpr_now(gpr_clock_type clock_type) {
// validate clock type
CHECK(clock_type == GPR_CLOCK_MONOTONIC ||
clock_type == GPR_CLOCK_REALTIME ||
clock_type == GPR_CLOCK_PRECISE);
CHECK(clock_type == GPR_CLOCK_MONOTONIC || clock_type == GPR_CLOCK_REALTIME ||
clock_type == GPR_CLOCK_PRECISE);
gpr_timespec ts = gpr_now_impl(clock_type);
// tv_nsecs must be in the range [0, 1e9).
CHECK(ts.tv_nsec >= 0 );
CHECK( ts.tv_nsec < 1e9);
CHECK(ts.tv_nsec >= 0);
CHECK(ts.tv_nsec < 1e9);
return ts;
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/gpr/posix/tmpfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <string.h>
#include <unistd.h>

#include <grpc/support/alloc.h>
#include "absl/log/check.h"
#include "absl/log/check.h"

#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>

Expand Down
3 changes: 1 addition & 2 deletions src/core/lib/gpr/subprocess_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@

#include <iostream>

#include "absl/log/check.h"
#include "absl/strings/substitute.h"

#include <grpc/support/alloc.h>
#include "absl/log/check.h"
#include "absl/log/check.h"
#include <grpc/support/log.h>

#include "src/core/lib/gpr/subprocess.h"
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/gpr/sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

#include <assert.h>

#include <grpc/support/atm.h>
#include "absl/log/check.h"
#include "absl/log/check.h"

#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>

Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/gpr/time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <string.h>

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

#include <grpc/support/log.h>
#include <grpc/support/time.h>

Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/gpr/windows/sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
!defined(GPR_CUSTOM_SYNC)

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

#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
Expand Down
6 changes: 3 additions & 3 deletions src/core/lib/gpr/windows/time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <sys/timeb.h>

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

#include <grpc/support/log.h>
#include <grpc/support/time.h>

Expand Down Expand Up @@ -99,8 +99,8 @@ void gpr_sleep_until(gpr_timespec until) {
delta = gpr_time_sub(until, now);
sleep_millis =
delta.tv_sec * GPR_MS_PER_SEC + delta.tv_nsec / GPR_NS_PER_MS;
CHECK((sleep_millis >= 0) );
CHECK( (sleep_millis <= INT_MAX));
CHECK((sleep_millis >= 0));
CHECK((sleep_millis <= INT_MAX));
Sleep((DWORD)sleep_millis);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/gprpp/chunked_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <utility>

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

#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>

Expand Down

0 comments on commit c5a75ba

Please sign in to comment.