# HG changeset patch # User Sascha Wilde # Date 1395941486 -3600 # Node ID 19de529ce7fba06f938c824a7b232b938f784afb # Parent 29467940b07b82c8c9f7b3ddb241297e421c913c Moved debug prefix to macro and added component specific prefix. diff -r 29467940b07b -r 19de529ce7fb cinst/mozilla.c --- a/cinst/mozilla.c Thu Mar 27 18:24:08 2014 +0100 +++ b/cinst/mozilla.c Thu Mar 27 18:31:26 2014 +0100 @@ -64,6 +64,8 @@ #include "portpath.h" #include "strhelp.h" +#define DEBUGPREFIX "MOZ-" + #ifndef _WIN32 #define CONFDIRS ".mozilla", ".thunderbird" #define TARGET_LINUX 1 @@ -104,7 +106,7 @@ return cdir; else { - DEBUGPRINTF("DEBUG: FATAL! No %s in environment.\n", envvar); + DEBUGPRINTF("FATAL! No %s in environment.\n", envvar); exit(ERR_MOZ_HOMELESS); } } @@ -135,7 +137,7 @@ if ((inifile = fopen(inifile_name, "r")) != NULL) { - DEBUGPRINTF("DEBUG: Searching for profile paths in: '%s'\n", inifile_name); + DEBUGPRINTF("Searching for profile paths in: '%s'\n", inifile_name); inifile_dirname = port_dirname(inifile_name); while (fgets(line, LINEBUFLEN, inifile) != NULL) @@ -163,13 +165,13 @@ strncpy(path, value, LINEBUFLEN); if ((fqpath = port_realpath(path)) != NULL) { - DEBUGPRINTF("DEBUG: Found profile path: '%s'\n", fqpath); + DEBUGPRINTF("Found profile path: '%s'\n", fqpath); strv_append(&dirs, fqpath, strlen(fqpath)); free (fqpath); } else { - DEBUGPRINTF("DEBUG: WARN! Non existent profile path: '%s'\n", path); + DEBUGPRINTF("WARN! Non existent profile path: '%s'\n", path); return_code |= WARN_MOZ_PROFILE_DOES_NOT_EXIST; } } @@ -182,7 +184,7 @@ } else { - DEBUGPRINTF("DEBUG: WARN! Could not open ini file: '%s'\n", inifile_name); + DEBUGPRINTF("WARN! Could not open ini file: '%s'\n", inifile_name); return_code |= WARN_MOZ_FAILED_TO_OPEN_INI; } return dirs; @@ -230,11 +232,11 @@ confdirs[i], mozdirent->d_name, "profiles.ini"); - DEBUGPRINTF("DEBUG: checking for %s...\n", path); + DEBUGPRINTF("checking for %s...\n", path); if ((fqpath = port_realpath(path)) != NULL) { strv_append(&inis, fqpath, strlen(fqpath)); - DEBUGPRINTF("DEBUG: Found mozilla ini file: '%s'\n", fqpath); + DEBUGPRINTF("Found mozilla ini file: '%s'\n", fqpath); free(fqpath); } } @@ -243,12 +245,12 @@ } else { - DEBUGPRINTF("DEBUG: Could not open %s/%s\n", confbase, confdirs[i]); + DEBUGPRINTF("Could not open %s/%s\n", confbase, confdirs[i]); } } if (inis == NULL) { - DEBUGPRINTF("DEBUG: No ini files found - will do nothing!\n"); + DEBUGPRINTF("No ini files found - will do nothing!\n"); exit(WARN_MOZ_NO_PROFILES); } return inis; diff -r 29467940b07b -r 19de529ce7fb common/debug.h --- a/common/debug.h Thu Mar 27 18:24:08 2014 +0100 +++ b/common/debug.h Thu Mar 27 18:31:26 2014 +0100 @@ -12,7 +12,7 @@ * Prints to stderr if RELEASE_BUILD is not defined. */ #ifndef RELEASE_BUILD -#define DEBUGPRINTF(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__); +#define DEBUGPRINTF(fmt, ...) fprintf(stderr, DEBUGPREFIX "DEBUG: " fmt, ##__VA_ARGS__); #else #define DEBUGPRINTF(fmt, ...) #endif