diff options
author | Robbie McElrath <rmcelrath@chromium.org> | 2019-08-20 22:22:53 +0000 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2021-07-25 20:55:42 -0700 |
commit | 481928d056110699f43d3710bd4f6bfb61789eb7 (patch) | |
tree | 28cac595bad6c79d202b78d520695689164ba740 /zucchini_main.cc | |
parent | 32cfcd8c5a5bd128dfe2c9da4b2a4769f3e05e78 (diff) | |
download | zucchini-481928d056110699f43d3710bd4f6bfb61789eb7.tar.gz |
Support initializing logging with a file descriptor rather than a path.
This CL adds an optional file descriptor to LoggingSettings, which can
be used to initialize logging to an already open file. Previously,
logging to a file required passing a path and letting the logging
system open() it for append. Passing a file-descriptor means that a
process can be sandboxed to have no access to the log directory, but
can still be passed a file-descriptor to log to.
This is needed for the Network Service on ChromeOS, whose logging needs
to be reinitialized to a new location after it's already started.
Bug: 977415
Change-Id: I2d07dc13a7e9f0f57d0802e4816628c181f183cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699477
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688754}
NOKEYCHECK=True
GitOrigin-RevId: 8bf4984f3ad0fb5fc8981f02ce9b96078a98632f
Diffstat (limited to 'zucchini_main.cc')
-rw-r--r-- | zucchini_main.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/zucchini_main.cc b/zucchini_main.cc index ab2c3e7..9b5e505 100644 --- a/zucchini_main.cc +++ b/zucchini_main.cc @@ -20,7 +20,7 @@ void InitLogging() { logging::LoggingSettings settings; settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG | logging::LOG_TO_STDERR; - settings.log_file = nullptr; + settings.log_file_path = nullptr; settings.lock_log = logging::DONT_LOCK_LOG_FILE; settings.delete_old = logging::APPEND_TO_OLD_LOG_FILE; bool logging_res = logging::InitLogging(settings); |