Move log warning about non-namespaced stacktraces

PiperOrigin-RevId: 553472372
Change-Id: Iba43cba78edd1826afb29f49a7e08e919554ed80
This commit is contained in:
Wiktor Garbacz 2023-08-03 07:37:13 -07:00 committed by Copybara-Service
parent 3f9e9a2b25
commit 4d625e521b
2 changed files with 6 additions and 5 deletions

View File

@ -1213,11 +1213,6 @@ absl::StatusOr<std::unique_ptr<Policy>> PolicyBuilder::TryBuild() {
output->SetNamespace(std::make_unique<Namespace>(
allow_unrestricted_networking_, std::move(mounts_), hostname_,
allow_mount_propagation_));
} else {
// Not explicitly disabling them here as this is a technical limitation in
// our stack trace collection functionality.
LOG(WARNING) << "Using policy without namespaces, disabling stack traces on"
<< " crash";
}
output->collect_stacktrace_on_signal_ = collect_stacktrace_on_signal_;

View File

@ -23,6 +23,8 @@
#include <utility>
#include "absl/base/macros.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include "sandboxed_api/sandbox2/comms.h"
#include "sandboxed_api/sandbox2/executor.h"
@ -46,6 +48,10 @@ class Sandbox2 final {
notify_(std::move(notify)) {
CHECK(executor_ != nullptr);
CHECK(policy_ != nullptr);
// This is a technical limitation in our stack trace collection
// functionality.
LOG(WARNING) << "Using policy without namespaces, disabling stack traces on"
<< " crash";
}
Sandbox2(const Sandbox2&) = delete;