From 2cacad60082fb457d7e47bab7aa51f187157ca9f Mon Sep 17 00:00:00 2001 From: Oliver Kunz Date: Wed, 21 Feb 2024 05:11:15 -0800 Subject: [PATCH] var_abstract: Use the string representation of Type. At the moment some Status and Log messages log the var Type enum which will just be an integer. Change this to use the string representation of the enum type. PiperOrigin-RevId: 608954450 Change-Id: I24447320b5f6f9f8ed22c91ca41f602bdf2ddbb8 --- sandboxed_api/var_abstract.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sandboxed_api/var_abstract.cc b/sandboxed_api/var_abstract.cc index 2027d66..6c9d56f 100644 --- a/sandboxed_api/var_abstract.cc +++ b/sandboxed_api/var_abstract.cc @@ -29,6 +29,7 @@ #include "sandboxed_api/util/raw_logging.h" #include "sandboxed_api/util/status_macros.h" #include "sandboxed_api/var_ptr.h" +#include "sandboxed_api/var_type.h" namespace sapi::v { @@ -98,9 +99,10 @@ absl::Status Var::TransferToSandboxee(RPCChannel* rpc_channel, pid_t pid) { << ", size: " << GetSize(); if (remote_ == nullptr) { - LOG(WARNING) << "Object: " << GetType() << " has no remote object set"; + LOG(WARNING) << "Object: " << GetTypeString() + << " has no remote object set"; return absl::FailedPreconditionError( - absl::StrCat("Object: ", GetType(), " has no remote object set")); + absl::StrCat("Object: ", GetTypeString(), " has no remote object set")); } struct iovec local = { @@ -136,7 +138,7 @@ absl::Status Var::TransferFromSandboxee(RPCChannel* rpc_channel, pid_t pid) { if (local_ == nullptr) { return absl::FailedPreconditionError( - absl::StrCat("Object: ", GetType(), " has no local storage set")); + absl::StrCat("Object: ", GetTypeString(), " has no local storage set")); } struct iovec local = {