]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
C++-ify logging routines
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 3 Aug 2020 05:04:31 +0000 (07:04 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 3 Aug 2020 05:04:31 +0000 (07:04 +0200)
- Simplified and C++-ified logging code.
- Added Logging::log and Logging::bulk_log functions corresponding to
  the old cc_log and cc_bulklog functions. The new functions pass their
  arguments to fmt::format.
- Replacements:
  * init_log → Logging::init
  * cc_log → Logging::log
  * cc_bulklog → Logging::bulk_log
  * cc_log_argv → Logging::log plus Util::format_argv_for_logging
  * cc_dump_debug_log_buffer -> Logging::dump_log
- A legacy cc_log implementation is still available so that logging can
  be converted gradually to the new functionality.

22 files changed:
src/CMakeLists.txt
src/Context.cpp
src/Hash.cpp
src/InodeCache.cpp
src/Lockfile.cpp
src/Logging.cpp [moved from src/logging.cpp with 52% similarity]
src/Logging.hpp [new file with mode: 0644]
src/Result.cpp
src/ResultDumper.cpp
src/ResultRetriever.cpp
src/Stat.cpp
src/Util.cpp
src/ZstdCompressor.cpp
src/argprocessing.cpp
src/ccache.cpp
src/cleanup.cpp
src/compress.cpp
src/execute.cpp
src/hashutil.cpp
src/logging.hpp [deleted file]
src/manifest.cpp
src/stats.cpp

index 7457b5595a4dbe849548db18523156061a411fa0..27c3f1fe3382f59a668e5ee3313cf3c52c4e94ee 100644 (file)
@@ -13,6 +13,7 @@ set(
   Decompressor.cpp
   Hash.cpp
   Lockfile.cpp
+  Logging.cpp
   MiniTrace.cpp
   NullCompressor.cpp
   NullDecompressor.cpp
@@ -36,7 +37,6 @@ set(
   execute.cpp
   hashutil.cpp
   language.cpp
-  logging.cpp
   manifest.cpp
   stats.cpp
   version.cpp)
index c2f25d75429bbe77f647ca8f2d1b0d2dd0cdcb4e..015827685e37cd200663b875568d05ba8ffdb7c0 100644 (file)
 #include "Context.hpp"
 
 #include "Counters.hpp"
+#include "Logging.hpp"
 #include "SignalHandler.hpp"
 #include "Util.hpp"
 #include "hashutil.hpp"
-#include "logging.hpp"
 #include "stats.hpp"
 
 #include <algorithm>
@@ -49,7 +49,7 @@ Context::~Context()
   // Dump log buffer last to not lose any logs.
   if (config.debug()) {
     std::string path = fmt::format("{}.ccache-log", args_info.output_obj);
-    cc_dump_debug_log_buffer(path.c_str());
+    Logging::dump_log(path);
   }
 }
 
index 2812c2d75ba7c8864d5ed355f775e1d3c57bcc8d..9d6079c656a8a122e29a0e1215b9c7d180b2474f 100644 (file)
@@ -19,7 +19,7 @@
 #include "Hash.hpp"
 
 #include "Fd.hpp"
-#include "logging.hpp"
+#include "Logging.hpp"
 
 using nonstd::string_view;
 
index 249afc4c2c1591f8cfd64a9b02622d11c8cb7225..6c4d7b8e0f87f9c109ea1c52bbeded8fe51188e2 100644 (file)
 #include "Fd.hpp"
 #include "Finalizer.hpp"
 #include "Hash.hpp"
+#include "Logging.hpp"
 #include "Stat.hpp"
 #include "TemporaryFile.hpp"
 #include "Util.hpp"
-#include "logging.hpp"
 
 #include <atomic>
 #include <libgen.h>
index 4e27bef3618787d291e8b3a8af659cec7200edec..e33a98d2295027aa8cab1aa2d16c361ea6b280ae 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "Lockfile.hpp"
 
+#include "Logging.hpp"
 #include "Util.hpp"
-#include "logging.hpp"
 
 #ifdef _WIN32
 #  include "Win32Util.hpp"
similarity index 52%
rename from src/logging.cpp
rename to src/Logging.cpp
index 5d34d6895261829c4ce62af3020e491c17fa6f3f..db895ca7e18348f5405d1ec0b641dca5c04f6392 100644 (file)
@@ -17,7 +17,7 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-#include "logging.hpp"
+#include "Logging.hpp"
 
 #include "Config.hpp"
 #include "File.hpp"
@@ -44,6 +44,8 @@
 #  include <tchar.h>
 #endif
 
+using nonstd::string_view;
+
 namespace {
 
 // Destination for g_config.log_file.
@@ -58,39 +60,28 @@ bool use_syslog;
 // Buffer used for logs in debug mode.
 std::string debug_log_buffer;
 
+// Whether debug logging is enabled via configuration or environment variable.
 bool debug_log_enabled = false;
 
-} // namespace
-
-// Initialize logging. Call only once.
-void
-init_log(const Config& config)
+// Print error message to stderr about failure writing to the log file and exit
+// with failure.
+[[noreturn]] void
+print_fatal_error_and_exit()
 {
-  debug_log_enabled = config.debug();
-
-#ifdef HAVE_SYSLOG
-  if (config.log_file() == "syslog") {
-    use_syslog = true;
-    openlog("ccache", LOG_PID, LOG_USER);
-    return; // Don't open logfile
-  }
-#endif
-
-  logfile_path = config.log_file();
-  logfile.open(logfile_path, "a");
-#ifndef _WIN32
-  if (logfile) {
-    Util::set_cloexec_flag(fileno(*logfile));
-  }
-#endif
+  // Note: Can't call fatal() since that would lead to recursion.
+  fprintf(stderr,
+          "ccache: error: Failed to write to %s: %s\n",
+          logfile_path.c_str(),
+          strerror(errno));
+  exit(EXIT_FAILURE);
 }
 
-static void
-log_prefix(bool log_updated_time)
+void
+do_log(string_view message, bool bulk)
 {
   static char prefix[200];
-#ifdef HAVE_GETTIMEOFDAY
-  if (log_updated_time) {
+
+  if (!bulk) {
     char timestamp[100];
     struct timeval tv;
     gettimeofday(&tv, nullptr);
@@ -107,137 +98,111 @@ log_prefix(bool log_updated_time)
              static_cast<int>(tv.tv_usec),
              static_cast<int>(getpid()));
   }
-#else
-  snprintf(prefix, sizeof(prefix), "[%-5d] ", static_cast<int>(getpid()));
-#endif
-  if (logfile) {
-    fputs(prefix, *logfile);
+
+  if (logfile
+      && (fputs(prefix, *logfile) == EOF
+          || fwrite(message.data(), message.length(), 1, *logfile) != 1
+          || fputc('\n', *logfile) == EOF
+          || (!bulk && fflush(*logfile) == EOF))) {
+    print_fatal_error_and_exit();
   }
 #ifdef HAVE_SYSLOG
   if (use_syslog) {
-    // prefix information will be added by syslog
+    // Note: No log prefix since syslog will add a prefix of its own.
+    syslog(
+      LOG_DEBUG, "%.*s", static_cast<int>(message.length()), message.data());
+    // Note: No trailing newline.
   }
 #endif
   if (debug_log_enabled) {
     debug_log_buffer += prefix;
+    debug_log_buffer.append(message.data(), message.length());
+    debug_log_buffer += '\n';
   }
 }
 
-static void warn_log_fail() ATTR_NORETURN;
+} // namespace
 
-// Warn about failure writing to the log file and then exit.
-static void
-warn_log_fail()
-{
-  // Note: Can't call fatal() since that would lead to recursion.
-  fprintf(stderr,
-          "ccache: error: Failed to write to %s: %s\n",
-          logfile_path.c_str(),
-          strerror(errno));
-  exit(EXIT_FAILURE);
-}
+namespace Logging {
 
-static void
-vlog(const char* format, va_list ap, bool log_updated_time)
+// Initialize logging. Call only once.
+void
+init(const Config& config)
 {
-  if (!(debug_log_enabled || logfile || use_syslog)) {
-    return;
-  }
+  debug_log_enabled = config.debug();
 
-  va_list aq;
-  va_copy(aq, ap);
-  log_prefix(log_updated_time);
-  if (logfile) {
-    int rc1 = vfprintf(*logfile, format, ap);
-    int rc2 = fprintf(*logfile, "\n");
-    if (rc1 < 0 || rc2 < 0) {
-      warn_log_fail();
-    }
-  }
 #ifdef HAVE_SYSLOG
-  if (use_syslog) {
-    vsyslog(LOG_DEBUG, format, ap);
+  if (config.log_file() == "syslog") {
+    use_syslog = true;
+    openlog("ccache", LOG_PID, LOG_USER);
+    return; // Don't open logfile
   }
 #endif
-  if (debug_log_enabled) {
-    char buf[8192];
-    int len = vsnprintf(buf, sizeof(buf), format, aq);
-    if (len >= 0) {
-      debug_log_buffer.append(
-        buf, std::min(static_cast<size_t>(len), sizeof(buf) - 1));
-      debug_log_buffer += "\n";
+
+  if (!config.log_file().empty()) {
+    logfile_path = config.log_file();
+    logfile.open(logfile_path, "a");
+    if (logfile) {
+      Util::set_cloexec_flag(fileno(*logfile));
+    } else {
+      print_fatal_error_and_exit();
     }
   }
-  va_end(aq);
 }
 
-// Write a message to the log file (adding a newline) and flush.
-void
-cc_log(const char* format, ...)
+bool
+enabled()
 {
-  va_list ap;
-  va_start(ap, format);
-  vlog(format, ap, true);
-  va_end(ap);
-  if (logfile) {
-    fflush(*logfile);
-  }
+  return debug_log_enabled || logfile || use_syslog;
 }
 
-// Write a message to the log file (adding a newline) without flushing and with
-// a reused timestamp.
 void
-cc_bulklog(const char* format, ...)
+log(string_view message)
 {
-  va_list ap;
-  va_start(ap, format);
-  vlog(format, ap, false);
-  va_end(ap);
+  if (!enabled()) {
+    return;
+  }
+  do_log(message, false);
 }
 
-// Log an executed command to the CCACHE_LOGFILE location.
 void
-cc_log_argv(const char* prefix, const char* const* argv)
+bulk_log(string_view message)
 {
-  if (!(debug_log_enabled || logfile || use_syslog)) {
+  if (!enabled()) {
     return;
   }
-
-  std::string argv_as_string = Util::format_argv_for_logging(argv);
-
-  log_prefix(true);
-  if (logfile) {
-    fputs(prefix, *logfile);
-    fwrite(argv_as_string.data(), argv_as_string.length(), 1, *logfile);
-    fputc('\n', *logfile);
-    int rc = fflush(*logfile);
-    if (rc) {
-      warn_log_fail();
-    }
-  }
-#ifdef HAVE_SYSLOG
-  if (use_syslog) {
-    syslog(LOG_DEBUG, "%s", Util::format_argv_for_logging(argv).c_str());
-  }
-#endif
-  if (debug_log_enabled) {
-    debug_log_buffer += prefix;
-    debug_log_buffer += argv_as_string;
-    debug_log_buffer += '\n';
-  }
+  do_log(message, true);
 }
 
-// Copy the current log memory buffer to an output file.
 void
-cc_dump_debug_log_buffer(const char* path)
+dump_log(const std::string& path)
 {
-  if (!debug_log_enabled) {
+  if (!enabled()) {
     return;
   }
   File file(path, "w");
   if (file) {
-    (void)fwrite(debug_log_buffer.data(), 1, debug_log_buffer.length(), *file);
+    (void)fwrite(debug_log_buffer.data(), debug_log_buffer.length(), 1, *file);
   } else {
-    cc_log("Failed to open %s: %s", path, strerror(errno));
+    log("Failed to open {}: {}", path, strerror(errno));
+  }
+}
+
+} // namespace Logging
+
+void
+cc_log(const char* format, ...)
+{
+  if (!Logging::enabled()) {
+    return;
   }
+
+  va_list ap;
+  va_start(ap, format);
+
+  char buffer[16384];
+  int size = vsnprintf(buffer, sizeof(buffer), format, ap);
+  Logging::log(string_view(buffer, size));
+
+  va_end(ap);
 }
diff --git a/src/Logging.hpp b/src/Logging.hpp
new file mode 100644 (file)
index 0000000..f074b02
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright (C) 2020 Joel Rosdahl and other contributors
+//
+// See doc/AUTHORS.adoc for a complete list of contributors.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#pragma once
+
+#include "system.hpp"
+
+#include "FormatNonstdStringView.hpp"
+
+#include "third_party/fmt/core.h"
+#include "third_party/nonstd/optional.hpp"
+#include "third_party/nonstd/string_view.hpp"
+
+#include <string>
+#include <utility>
+
+class Config;
+
+namespace Logging {
+
+// Initialize global logging state. Must be called once before using the other
+// logging functions.
+void init(const Config& config);
+
+// Return whether logging is enabled to at least one destination.
+bool enabled();
+
+// Log `message` (plus a newline character).
+void log(nonstd::string_view message);
+
+// Log `message` (plus a newline character) without flushing and with a reused
+// timestamp.
+void bulk_log(nonstd::string_view message);
+
+// Write the current log memory buffer `path`.
+void dump_log(const std::string& path);
+
+// Log a message (plus a newline character). `args` are forwarded to
+// `fmt::format`.
+template<typename... T>
+inline void
+log(T&&... args)
+{
+  if (!enabled()) {
+    return;
+  }
+  log(nonstd::string_view(fmt::format(std::forward<T>(args)...)));
+}
+
+// Log a message (plus a newline character) without flushing and with a reused
+// timestamp. `args` are forwarded to `fmt::format`.
+template<typename... T>
+inline void
+bulk_log(T&&... args)
+{
+  if (!enabled()) {
+    return;
+  }
+  bulk_log(nonstd::string_view(fmt::format(std::forward<T>(args)...)));
+}
+
+} // namespace Logging
+
+// Legacy API.
+void cc_log(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
index b5d76a2dc19e8a110740707ebca4808eea2682dd..02b8e30e51c47b049cdddbb2821cf0f4d4b9bdf8 100644 (file)
 #include "Context.hpp"
 #include "Fd.hpp"
 #include "File.hpp"
+#include "Logging.hpp"
 #include "Stat.hpp"
 #include "Util.hpp"
 #include "exceptions.hpp"
-#include "logging.hpp"
 #include "stats.hpp"
 
 // Result data format
index e6cd1129fea8998b033adc13ce8b516266d1e4e8..7c740afd8f3a4632e877dc95833b9a594ad57b3d 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "CacheEntryReader.hpp"
 #include "Context.hpp"
-#include "logging.hpp"
+#include "Logging.hpp"
 
 using nonstd::optional;
 
index fbf7bed182ca0bc04b9e6df039b4ef62fc03bf56..37d30f5f213ad9403a5b898f45d639df8158723f 100644 (file)
@@ -19,7 +19,7 @@
 #include "ResultRetriever.hpp"
 
 #include "Context.hpp"
-#include "logging.hpp"
+#include "Logging.hpp"
 
 #include "third_party/nonstd/string_view.hpp"
 
index 7b398ba6996c2b884443f642e9f70941cbc0360e..ae6215447b14a398b67e0fc483f1aa7274442595 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "Stat.hpp"
 
-#include "logging.hpp"
+#include "Logging.hpp"
 
 #include "third_party/fmt/core.h"
 
index 3692cc0a15b6153912acef254674df13c283bf3b..c7a6e6e1110d545b4bf7bcf1b9d904fef063eb76 100644 (file)
@@ -22,8 +22,8 @@
 #include "Context.hpp"
 #include "Fd.hpp"
 #include "FormatNonstdStringView.hpp"
+#include "Logging.hpp"
 #include "TemporaryFile.hpp"
-#include "logging.hpp"
 
 #include <algorithm>
 #include <fstream>
index 37ea7e3f23d91ebf857d0badf2deb5fb11db32c1..1524808caee01ced7c07dd0b6bdb4873a05f7a7e 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "ZstdCompressor.hpp"
 
+#include "Logging.hpp"
 #include "exceptions.hpp"
-#include "logging.hpp"
 
 const uint8_t k_default_zstd_compression_level = 1;
 
index 773bdedc00059ba3ab70ee0c971d11d48a5acc67..b471128c55b749c9a73a0192208d81f5e0a2439c 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "Context.hpp"
 #include "FormatNonstdStringView.hpp"
+#include "Logging.hpp"
 #include "compopt.hpp"
 #include "language.hpp"
-#include "logging.hpp"
 
 #include <cassert>
 
index 682576b644c489efd61aeae4a6a84b8b248e2de9..8ba561b8a2e9ebe00295d76ce36defa6fbd987b0 100644 (file)
@@ -26,6 +26,7 @@
 #include "File.hpp"
 #include "FormatNonstdStringView.hpp"
 #include "Hash.hpp"
+#include "Logging.hpp"
 #include "MiniTrace.hpp"
 #include "ProgressBar.hpp"
 #include "Result.hpp"
@@ -45,7 +46,6 @@
 #include "execute.hpp"
 #include "hashutil.hpp"
 #include "language.hpp"
-#include "logging.hpp"
 #include "manifest.hpp"
 #include "stats.hpp"
 
@@ -66,6 +66,7 @@
 #include <algorithm>
 #include <limits>
 
+using Logging::log;
 using nonstd::nullopt;
 using nonstd::optional;
 using nonstd::string_view;
@@ -1826,7 +1827,7 @@ initialize(Context& ctx, int argc, const char* const* argv)
 {
   bool primary_config_exists = set_up_config(ctx.config);
   set_up_context(ctx, argc, argv);
-  init_log(ctx.config);
+  Logging::init(ctx.config);
 
   // Set default umask for all files created by ccache from now on (if
   // configured to). This is intentionally done after calling init_log so that
@@ -1874,8 +1875,7 @@ configuration_logger(const std::string& key,
                      const std::string& value,
                      const std::string& origin)
 {
-  cc_bulklog(
-    "Config: (%s) %s = %s", origin.c_str(), key.c_str(), value.c_str());
+  Logging::bulk_log("Config: ({}) {} = {}", origin, key, value);
 }
 
 static void
@@ -1932,7 +1932,7 @@ cache_compilation(int argc, const char* const* argv)
     Args saved_orig_args(std::move(ctx->orig_args));
     auto execv_argv = saved_orig_args.to_argv();
 
-    cc_log_argv("Executing ", execv_argv.data());
+    log("Executing {}", Util::format_argv_for_logging(execv_argv.data()));
     ctx.reset(); // Dump debug logs last thing before executing.
     execv(execv_argv[0], const_cast<char* const*>(execv_argv.data()));
     fatal("execv of {} failed: {}", execv_argv[0], strerror(errno));
@@ -1968,7 +1968,7 @@ do_cache_compilation(Context& ctx, const char* const* argv)
   set_up_uncached_err();
   MTR_END("main", "set_up_uncached_err");
 
-  cc_log_argv("Command line: ", argv);
+  log("Command line: {}", Util::format_argv_for_logging(argv));
   cc_log("Hostname: %s", Util::get_hostname());
   cc_log("Working directory: %s", ctx.actual_cwd.c_str());
   if (ctx.apparent_cwd != ctx.actual_cwd) {
index 5f5e9ab50ff5c18ecf415db53fcd418322102905..158cf772532e84e3890594dc01829fe414d40822 100644 (file)
@@ -22,8 +22,8 @@
 #include "CacheFile.hpp"
 #include "Config.hpp"
 #include "Context.hpp"
+#include "Logging.hpp"
 #include "Util.hpp"
-#include "logging.hpp"
 #include "stats.hpp"
 
 #ifdef INODE_CACHE_SUPPORTED
index 7e602d7b8eb5e68e46ab3931e7f3b1922c8f8279..fff80e1835588f8e981f985a5d4db23e0462d170 100644 (file)
 #include "CacheEntryWriter.hpp"
 #include "Context.hpp"
 #include "File.hpp"
+#include "Logging.hpp"
 #include "Result.hpp"
 #include "StdMakeUnique.hpp"
 #include "ThreadPool.hpp"
-#include "logging.hpp"
 #include "manifest.hpp"
 #include "stats.hpp"
 
index 72e08cbd68da2014827afe4504867b89628b1fab..78759d3faab82a555a9b3a4e7b9f82aef9f1bd82 100644 (file)
 #include "Config.hpp"
 #include "Context.hpp"
 #include "Fd.hpp"
+#include "Logging.hpp"
 #include "SignalHandler.hpp"
 #include "Stat.hpp"
 #include "TemporaryFile.hpp"
 #include "Util.hpp"
-#include "logging.hpp"
 
 #ifdef _WIN32
 #  include "Win32Util.hpp"
 #endif
 
+using Logging::log;
 using nonstd::string_view;
 
 #ifdef _WIN32
@@ -157,7 +158,7 @@ win32execute(const char* path,
 int
 execute(const char* const* argv, Fd&& fd_out, Fd&& fd_err, pid_t* pid)
 {
-  cc_log_argv("Executing ", argv);
+  log("Executing {}", Util::format_argv_for_logging(argv));
 
   {
     SignalHandlerBlocker signal_handler_blocker;
index 83306194dec3a43eff9f8b3c99742ee694813e74..26689ca946a8caaaa6bae2ac6e9eb6a7915edc26 100644 (file)
 #include "Config.hpp"
 #include "Context.hpp"
 #include "Hash.hpp"
+#include "Logging.hpp"
 #include "Stat.hpp"
 #include "ccache.hpp"
 #include "execute.hpp"
-#include "logging.hpp"
 #include "macroskip.hpp"
 #include "stats.hpp"
 
@@ -56,6 +56,7 @@
 #  include <immintrin.h>
 #endif
 
+using Logging::log;
 using nonstd::string_view;
 
 namespace {
@@ -397,7 +398,8 @@ hash_command_output(Hash& hash,
   }
 
   auto argv = args.to_argv();
-  cc_log_argv("Executing compiler check command ", argv.data());
+  log("Executing compiler check command {}",
+      Util::format_argv_for_logging(argv.data()));
 
 #ifdef _WIN32
   PROCESS_INFORMATION pi;
diff --git a/src/logging.hpp b/src/logging.hpp
deleted file mode 100644 (file)
index e65a353..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2020 Joel Rosdahl and other contributors
-//
-// See doc/AUTHORS.adoc for a complete list of contributors.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 3 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-// more details.
-//
-// You should have received a copy of the GNU General Public License along with
-// this program; if not, write to the Free Software Foundation, Inc., 51
-// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-#pragma once
-
-#include "system.hpp"
-
-#include <string>
-
-class Config;
-
-void init_log(const Config& config);
-void cc_log(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
-void cc_bulklog(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
-void cc_log_argv(const char* prefix, const char* const* argv);
-void cc_dump_debug_log_buffer(const char* path);
index b0b7d4cd8f2988bd41c5eea4d34d08dc4163c7fe..afb0bea89edfb72dded590fca6b3cf9a42f3d44c 100644 (file)
 #include "Digest.hpp"
 #include "File.hpp"
 #include "Hash.hpp"
+#include "Logging.hpp"
 #include "StdMakeUnique.hpp"
 #include "ccache.hpp"
 #include "hashutil.hpp"
-#include "logging.hpp"
 
 // Manifest data format
 // ====================
index c57aaa2f5d0551512f14ce96f889a66900601337..01d47003742e1a20335f339b4b688a19ac22444b 100644 (file)
@@ -26,9 +26,9 @@
 #include "Context.hpp"
 #include "Counters.hpp"
 #include "Lockfile.hpp"
+#include "Logging.hpp"
 #include "cleanup.hpp"
 #include "hashutil.hpp"
-#include "logging.hpp"
 
 #include "third_party/fmt/core.h"