namespace {
-// Destination for g_config.log_file.
-File logfile;
-
-// Path to the logfile.
+// Logfile path and file handle, read from Config::log_file().
std::string logfile_path;
+File logfile;
// Whether to use syslog() instead.
bool use_syslog;
return true;
}
-// This function hashes an include file and stores the path and hash in the
-// global g_included_files variable. If the include file is a PCH, cpp_hash is
-// also updated.
+// This function hashes an include file and stores the path and hash in
+// ctx.included_files. If the include file is a PCH, cpp_hash is also updated.
static void
remember_include_file(Context& ctx,
const std::string& path,
if (!ctx.config.depend_mode()) {
// Find the hash using the preprocessed output. Also updates
- // g_included_files.
+ // ctx.included_files.
Hash cpp_hash = common_hash;
init_hash_debug(ctx,
cpp_hash,
file.commit();
} catch (const Error& e) {
// Make failure to write a stats file a soft error since it's not important
- // enough to fail whole the process.
+ // enough to fail whole the process AND because it is called in the Context
+ // destructor.
log("Error: {}", e.what());
}
}