mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Internal refactor to replace unsupported dependencies.
PiperOrigin-RevId: 427474223
This commit is contained in:
committed by
Copybara-Service
parent
7dbe976c51
commit
efdd4c0f6a
@@ -35,17 +35,14 @@ cc_library(
|
||||
defines = ["NO_WEBRTC"],
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//base",
|
||||
"//base:stringprintf",
|
||||
"//internal/platform:base",
|
||||
"//internal/platform:util",
|
||||
"//internal/platform/implementation:platform",
|
||||
"//internal/platform/implementation:types",
|
||||
"//internal/platform/implementation/shared:count_down_latch",
|
||||
"//internal/platform/implementation/shared:posix_mutex",
|
||||
"@com_google_absl//absl/base:core_headers",
|
||||
"@com_google_absl//absl/synchronization",
|
||||
"@com_google_absl//absl/time",
|
||||
"@com_google_glog//:glog",
|
||||
"@com_google_nisaba//nisaba/port:thread_pool",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -15,13 +15,25 @@
|
||||
#include "internal/platform/implementation/g3/log_message.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "base/stringprintf.h"
|
||||
#include <cstdio>
|
||||
|
||||
namespace location {
|
||||
namespace nearby {
|
||||
namespace g3 {
|
||||
|
||||
namespace {
|
||||
|
||||
// This is a partial copy of base::StringAppendV for OSS compilation.
|
||||
void NearbyStringAppendV(std::string* dst, const char* format, va_list ap) {
|
||||
// Fixed size buffer 1024 should be big enough.
|
||||
static const int kSpaceLength = 1024;
|
||||
char space[kSpaceLength];
|
||||
int result = vsnprintf(space, kSpaceLength, format, ap);
|
||||
va_end(ap);
|
||||
dst->append(space, result);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
api::LogMessage::Severity g_min_log_severity = api::LogMessage::Severity::kInfo;
|
||||
|
||||
inline absl::LogSeverity ConvertSeverity(api::LogMessage::Severity severity) {
|
||||
@@ -50,7 +62,7 @@ void LogMessage::Print(const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
std::string result;
|
||||
StringAppendV(&result, format, ap);
|
||||
NearbyStringAppendV(&result, format, ap);
|
||||
log_streamer_.stream() << result;
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user