Commit 5411974b authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

logging: DCHECK log_file_path if LOG_TO_FILE is set

Currently if LOG_TO_FILE is set but log_file_path is null it'll crash
without warning. This CL adds a DCHECK to make this requirement clear.

Bug: 1137080
Change-Id: Icc7747e7d0ed2d698d13ddc58751ba6ccf97d5c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463074
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815963}
parent 82142c1f
......@@ -421,6 +421,8 @@ bool BaseInitLoggingImpl(const LoggingSettings& settings) {
return true;
}
#endif
DCHECK(settings.log_file_path) << "LOG_TO_FILE set but no log_file_path!";
if (!g_log_file_name)
g_log_file_name = new PathString();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment