From fde4b10dc1c8c600d908acc57165b6531f6465d6 Mon Sep 17 00:00:00 2001 From: Chiaki ISHIKAWA Date: Tue, 10 Mar 2015 22:11:16 +0900 Subject: [PATCH 5/8] Enhance log message: add prefix (var. name) and a few additions. --- ccache.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ccache.c b/ccache.c index 65e376a..02a0d76 100644 --- a/ccache.c +++ b/ccache.c @@ -790,6 +790,7 @@ to_cache(struct args *args) args_add(args, output_obj); if (output_dia) { + cc_log("(output_dia) Outputting to final destination: %s", output_dia); args_add(args, "--serialize-diagnostics"); args_add(args, output_dia); } @@ -884,17 +885,18 @@ to_cache(struct args *args) exit(status); } + cc_log("verbose: (tmp_stderr) %s being removed", tmp_stderr); tmp_unlink(tmp_stderr); failed(); } if (stat(output_obj, &st) != 0) { - cc_log("Compiler didn't produce an object file"); + cc_log("(output_obj) Compiler didn't produce an object file"); stats_update(STATS_NOOUTPUT); failed(); } if (st.st_size == 0) { - cc_log("Compiler produced an empty object file"); + cc_log("(output_obj) Compiler produced an empty object file"); stats_update(STATS_EMPTYOUTPUT); failed(); } @@ -913,7 +915,7 @@ to_cache(struct args *args) stats_update(STATS_ERROR); failed(); } - cc_log("Stored in cache: %s", cached_stderr); + cc_log("(cached_stderr) Stored in cache: %s", cached_stderr); if (conf->compression) { /* * The file was compressed, so obtain the compressed @@ -941,12 +943,13 @@ to_cache(struct args *args) if (output_dia) { if (stat(output_dia, &st) != 0) { - cc_log("Failed to stat %s: %s", output_dia, strerror(errno)); + cc_log("(output_dia) Failed to stat %s: %s", output_dia, strerror(errno)); stats_update(STATS_ERROR); failed(); } if (st.st_size > 0) { put_file_in_cache(output_dia, cached_dia); + cc_log("(cached_dia) Stored in cache: %s", cached_dia); } } @@ -1495,13 +1498,13 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest) /* Check if the object file is there. */ if (stat(cached_obj, &st) != 0) { - cc_log("Object file %s not in cache", cached_obj); + cc_log("(cached_obj) Object file %s not in cache", cached_obj); return; } /* Check if the diagnostic file is there. */ if (output_dia && stat(cached_dia, &st) != 0) { - cc_log("Diagnostic file %s not in cache", cached_dia); + cc_log("(cached_dia) Diagnostic file %s not in cache", cached_dia); return; } @@ -1510,7 +1513,7 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest) * meta-data with no content. Catch an easy case of this. */ if (st.st_size == 0) { - cc_log("Invalid (empty) object file %s in cache", cached_obj); + cc_log("(cached_obj) Invalid (empty) object file %s in cache", cached_obj); x_unlink(cached_obj); return; } @@ -1529,12 +1532,15 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest) if (!str_eq(output_obj, "/dev/null")) { get_file_from_cache(cached_obj, output_obj); + cc_log("Created (output_obj) %s from (cached_obj) %s", output_obj, cached_obj); } if (produce_dep_file) { get_file_from_cache(cached_dep, output_dep); + cc_log("Created (output_dep) %s from (cached_dep) %s", output_dep, cached_dep); } if (output_dia) { get_file_from_cache(cached_dia, output_dia); + cc_log("Created (output_dia) %s from (cached_dia) %s", output_dia, cached_dia); } /* Update modification timestamps to save files from LRU cleanup. @@ -2658,7 +2664,7 @@ ccache(int argc, char *argv[]) if (output_dia) { cc_log("Diagnostic file: %s", output_dia); } - cc_log("Object file: %s", output_obj); + cc_log("(output_obj) Object file: %s", output_obj); hash_start(&common_hash); calculate_common_hash(preprocessor_args, &common_hash); -- 2.1.4