Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ cf_cc_binary(
"//cuttlefish/host/libs/config:logging",
"//cuttlefish/result",
"//libbase",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@gflags",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <string>

#include <android-base/strings.h>
#include "absl/log/check.h"
#include "absl/log/log.h"

#include "cuttlefish/common/libs/fs/shared_fd.h"

Expand Down Expand Up @@ -71,7 +73,7 @@ SharedFD TcpClient::Start() {

if (client->IsOpen()) {
last_failure_reason_ = 0;
LOG(DEBUG) << "Connected to socket:" << host_ << ":" << port_;
VLOG(0) << "Connected to socket:" << host_ << ":" << port_;
return client;
} else {
// Don't log if the previous connection failed with the same error
Expand All @@ -97,7 +99,7 @@ SharedFD VsockClient::Start() {

if (vsock_socket->IsOpen()) {
last_failure_reason_ = 0;
LOG(DEBUG) << "Connected to vsock:" << id_ << ":" << port_;
VLOG(0) << "Connected to vsock:" << id_ << ":" << port_;
} else {
// Don't log if the previous connection failed with the same error
if (last_failure_reason_ != vsock_socket->GetErrno()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <set>
#include <thread>

#include "absl/log/log.h"

#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/common/libs/utils/contains.h"
#include "cuttlefish/result/result.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@

#include <chrono>
#include <memory>
#include <sstream>

#include <android-base/logging.h>
#include <gflags/gflags.h>
#include "absl/log/check.h"
#include "absl/log/log.h"

#include "cuttlefish/common/frontend/socket_vsock_proxy/client.h"
#include "cuttlefish/common/frontend/socket_vsock_proxy/server.h"
#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/common/libs/utils/socket2socket_proxy.h"
#include "cuttlefish/common/libs/utils/tee_logging.h"
#include "cuttlefish/host/commands/kernel_log_monitor/utils.h"
#include "cuttlefish/result/result.h"

Expand Down Expand Up @@ -175,7 +174,7 @@ static Result<void> ListenEventsAndProxy(int events_fd,
proxy = CF_EXPECT(StartProxyAsync(server, client));
}

LOG(DEBUG) << "Start reading events to start/stop proxying";
VLOG(0) << "Start reading events to start/stop proxying";
while (events->IsOpen()) {
Result<std::optional<monitor::ReadEventResult>> received_event =
monitor::ReadEvent(events);
Expand All @@ -189,7 +188,7 @@ static Result<void> ListenEventsAndProxy(int events_fd,
continue;
}
if (!(*received_event)) {
LOG(DEBUG) << "Kernel log message channel closed";
VLOG(0) << "Kernel log message channel closed";
break;
}

Expand Down Expand Up @@ -224,7 +223,7 @@ Result<void> Main() {
CF_EXPECT(ListenEventsAndProxy(FLAGS_events_fd, start_event, stop_event,
*server, *client));
} else {
LOG(DEBUG) << "Starting proxy";
VLOG(0) << "Starting proxy";
Proxy(CF_EXPECT(server->Start()), [&client] { return client->Start(); });
}

Expand All @@ -238,12 +237,11 @@ Result<void> Main() {
int main(int argc, char* argv[]) {
signal(SIGPIPE, SIG_IGN);

cuttlefish::DefaultSubprocessLogging(
argv, cuttlefish::MetadataLevel::TAG_AND_MESSAGE);
cuttlefish::DefaultSubprocessLogging(argv);
google::ParseCommandLineFlags(&argc, &argv, true);

if (!FLAGS_label.empty()) {
android::base::SetDefaultTag("proxy_" + FLAGS_label);
LOG(WARNING) << "Log tags unsupported with abseil logging: " << FLAGS_label;
}

auto result = cuttlefish::socket_proxy::Main();
Expand Down
1 change: 1 addition & 0 deletions base/cvd/cuttlefish/common/libs/concurrency/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ cf_cc_library(
"semaphore.h",
"thread_safe_queue.h",
],
deps = ["@abseil-cpp//absl/log:check"],
)
2 changes: 2 additions & 0 deletions base/cvd/cuttlefish/common/libs/concurrency/multiplexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <memory>
#include <vector>

#include "absl/log/check.h"

#include "cuttlefish/common/libs/concurrency/semaphore.h"

namespace cuttlefish {
Expand Down
2 changes: 2 additions & 0 deletions base/cvd/cuttlefish/common/libs/confui/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ cf_cc_library(
"//cuttlefish/common/libs/utils:contains",
"//libbase",
"//teeui/libteeui",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@boringssl//:crypto",
],
)
2 changes: 2 additions & 0 deletions base/cvd/cuttlefish/common/libs/confui/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <string>
#include <vector>

#include "absl/log/check.h"

namespace cuttlefish {
namespace confui {
namespace packet {
Expand Down
1 change: 0 additions & 1 deletion base/cvd/cuttlefish/common/libs/confui/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <type_traits>
#include <vector>

#include <android-base/logging.h>
#include <android-base/strings.h>

#include "cuttlefish/common/libs/confui/packet_types.h"
Expand Down
6 changes: 4 additions & 2 deletions base/cvd/cuttlefish/common/libs/confui/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>

#include <android-base/logging.h>
#include "absl/log/check.h"
#include "absl/log/log.h"

namespace cuttlefish {
template <typename T>
Expand Down Expand Up @@ -59,6 +59,8 @@ inline bool IsOnlyDigits(const std::string& src) {

// note that no () surrounding LOG(level) << "ConfUI:" is crucial
#define ConfUiLog(LOG_LEVEL) LOG(LOG_LEVEL) << "ConfUI: "
#define ConfUiLogDebug VLOG(0) << "ConfUI: "
#define ConfUiLogVerbose VLOG(1) << "ConfUI: "

// TODO([email protected]): make these look more like LOG(level)
#define ConfUiCheck(cond) CHECK(cond) << "ConfUI: "
Expand Down
2 changes: 2 additions & 0 deletions base/cvd/cuttlefish/common/libs/fs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ cf_cc_library(
"//cuttlefish/posix:strerror",
"//cuttlefish/result",
"//libbase",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@fmt",
],
)
Expand Down
5 changes: 3 additions & 2 deletions base/cvd/cuttlefish/common/libs/fs/shared_fd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
#include <vector>

#include <android-base/file.h>
#include <android-base/logging.h>
#include <fmt/format.h>
#include "absl/log/check.h"
#include "absl/log/log.h"

#include "cuttlefish/common/libs/fs/shared_buf.h"
#include "cuttlefish/common/libs/fs/shared_select.h"
Expand Down Expand Up @@ -226,7 +227,7 @@ int FileInstance::ConnectWithTimeout(const struct sockaddr* addr,
}

if (GetErrno() != EAGAIN && GetErrno() != EINPROGRESS) {
LOG(DEBUG) << "Immediate connection failure: " << StrError();
VLOG(0) << "Immediate connection failure: " << StrError();
if (Fcntl(F_SETFL, original_flags) == -1) {
LOG(ERROR) << "Failed to restore original flags: " << StrError();
}
Expand Down
1 change: 1 addition & 0 deletions base/cvd/cuttlefish/common/libs/security/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cf_cc_library(
deps = [
"//cuttlefish/common/libs/fs",
"//libbase",
"@abseil-cpp//absl/log",
],
)

Expand Down
2 changes: 0 additions & 2 deletions base/cvd/cuttlefish/common/libs/security/confui_sign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include <optional>
#include <vector>

#include <android-base/logging.h>

#include "cuttlefish/common/libs/fs/shared_buf.h"

namespace cuttlefish {
Expand Down
1 change: 1 addition & 0 deletions base/cvd/cuttlefish/common/libs/transport/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ cf_cc_library(
"//cuttlefish/common/libs/fs",
"//cuttlefish/result",
"//libbase",
"@abseil-cpp//absl/log",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
#include "cuttlefish/common/libs/transport/channel_sharedfd.h"

#include <poll.h>

#include <vector>

#include "absl/log/log.h"

#include "cuttlefish/common/libs/fs/shared_buf.h"

namespace cuttlefish {
Expand All @@ -41,7 +44,7 @@ Result<ManagedMessage> SharedFdChannel::ReceiveMessage() {
CF_EXPECT(read == sizeof(RawMessage),
"Expected " << sizeof(RawMessage) << ", received " << read << "\n"
<< "Could not read message: " << input_->StrError());
LOG(DEBUG) << "Received message with id: " << message_header.command;
VLOG(0) << "Received message with id: " << message_header.command;

auto message = CF_EXPECT(CreateMessage(message_header.command,
message_header.is_response,
Expand Down Expand Up @@ -77,4 +80,4 @@ Result<void> SharedFdChannel::SendMessage(RawMessage& message, bool response) {
}

} // namespace transport
} // namespace cuttlefish
} // namespace cuttlefish
Loading
Loading