diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2012-03-07 17:22:58 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-03-04 02:54:10 +0100 |
commit | e9696710fd46af151364cb8626f62a7de194c8f2 (patch) | |
tree | 8c28fac86d78d767a6c22584ea40f552796c7130 /kdecore | |
parent | f29973ff64995727b9f5c0c43d65881d8af65f5e (diff) | |
download | tdelibs-e9696710fd46af151364cb8626f62a7de194c8f2.tar.gz tdelibs-e9696710fd46af151364cb8626f62a7de194c8f2.zip |
Add source code module name to stdout/stderr messages to improve readability.
(cherry picked from commit e15521d96b21cb0c771cce7cbe2ceb38f27c8844)
Diffstat (limited to 'kdecore')
-rw-r--r-- | kdecore/kcrash.cpp | 30 | ||||
-rw-r--r-- | kdecore/netwm.cpp | 4 | ||||
-rw-r--r-- | kdecore/tests/ksimpleconfigtest.cpp | 6 |
3 files changed, 20 insertions, 20 deletions
diff --git a/kdecore/kcrash.cpp b/kdecore/kcrash.cpp index dd758f034..4d3872f8f 100644 --- a/kdecore/kcrash.cpp +++ b/kdecore/kcrash.cpp @@ -148,10 +148,10 @@ KCrash::defaultCrashHandler (int sig) if (appName) { #ifndef NDEBUG - fprintf(stderr, "KCrash: crashing... crashRecursionCounter = %d\n", crashRecursionCounter); - fprintf(stderr, "KCrash: Application Name = %s path = %s pid = %d\n", appName ? appName : "<unknown>" , appPath ? appPath : "<unknown>", getpid()); + fprintf(stderr, "[kcrash] KCrash: crashing... crashRecursionCounter = %d\n", crashRecursionCounter); + fprintf(stderr, "[kcrash] KCrash: Application Name = %s path = %s pid = %d\n", appName ? appName : "<unknown>" , appPath ? appPath : "<unknown>", getpid()); #else - fprintf(stderr, "KCrash: Application '%s' crashing...\n", appName ? appName : "<unknown>"); + fprintf(stderr, "[kcrash] KCrash: Application '%s' crashing...\n", appName ? appName : "<unknown>"); #endif const char * argv[24]; // don't forget to update this @@ -231,13 +231,13 @@ KCrash::defaultCrashHandler (int sig) } else { - fprintf(stderr, "Unknown appname\n"); + fprintf(stderr, "[kcrash] Unknown appname\n"); } } if (crashRecursionCounter < 4) { - fprintf(stderr, "Unable to start Dr. Konqi\n"); + fprintf(stderr, "[kcrash] Unable to start Dr. Konqi\n"); } #endif //Q_OS_UNIX @@ -277,7 +277,7 @@ void KCrash::startDrKonqi( const char* argv[], int argc ) int len = strlen( argv[ i ] ) + 1; // include terminating \0 if( pos + len > BUFSIZE ) { - fprintf( stderr, "BUFSIZE in KCrash not big enough!\n" ); + fprintf( stderr, "[kcrash] BUFSIZE in KCrash not big enough!\n" ); startDirectly( argv, argc ); return; } @@ -317,7 +317,7 @@ void KCrash::startDrKonqi( const char* argv[], int argc ) // If we can't reach kdeinit we can still at least try to fork() void KCrash::startDirectly( const char* argv[], int ) { - fprintf( stderr, "KCrash cannot reach kdeinit, launching directly.\n" ); + fprintf( stderr, "[kcrash] KCrash cannot reach kdeinit, launching directly.\n" ); pid_t pid = fork(); if (pid <= 0) { @@ -448,12 +448,12 @@ static int openSocket() { if (!home_dir || !home_dir[0]) { - fprintf(stderr, "Warning: $HOME not set!\n"); + fprintf(stderr, "[kcrash] Warning: $HOME not set!\n"); return -1; } if (strlen(home_dir) > (MAX_SOCK_FILE-100)) { - fprintf(stderr, "Warning: Home directory path too long!\n"); + fprintf(stderr, "[kcrash] Warning: Home directory path too long!\n"); return -1; } kde_home++; @@ -470,7 +470,7 @@ static int openSocket() strncat(sock_file, getenv("XAUTHLOCALHOSTNAME"), MAX_SOCK_FILE - strlen(sock_file) - 1); else if (gethostname(sock_file+strlen(sock_file), MAX_SOCK_FILE - strlen(sock_file) - 1) != 0) { - perror("Warning: Could not determine hostname: "); + perror("[kcrash] Warning: Could not determine hostname: "); return -1; } sock_file[sizeof(sock_file)-1] = '\0'; @@ -479,13 +479,13 @@ static int openSocket() display = getDisplay(); if (display == NULL) { - fprintf(stderr, "Error: Could not determine display.\n"); + fprintf(stderr, "[kcrash] Error: Could not determine display.\n"); return -1; } if (strlen(sock_file)+strlen(display)+strlen("/kdeinit_")+2 > MAX_SOCK_FILE) { - fprintf(stderr, "Warning: Socket name will be too long.\n"); + fprintf(stderr, "[kcrash] Warning: Socket name will be too long.\n"); free(display); return -1; } @@ -495,7 +495,7 @@ static int openSocket() if (strlen(sock_file) >= sizeof(server.sun_path)) { - fprintf(stderr, "Warning: Path of socketfile exceeds UNIX_PATH_MAX.\n"); + fprintf(stderr, "[kcrash] Warning: Path of socketfile exceeds UNIX_PATH_MAX.\n"); return -1; } @@ -505,7 +505,7 @@ static int openSocket() s = socket(PF_UNIX, SOCK_STREAM, 0); if (s < 0) { - perror("Warning: socket() failed: "); + perror("[kcrash] Warning: socket creation failed: "); return -1; } @@ -514,7 +514,7 @@ static int openSocket() socklen = sizeof(server); if(connect(s, (struct sockaddr *)&server, socklen) == -1) { - perror("Warning: connect() failed: "); + perror("[kcrash] Warning: socket connection failed: "); close(s); return -1; } diff --git a/kdecore/netwm.cpp b/kdecore/netwm.cpp index 455b6db65..bc352c8bc 100644 --- a/kdecore/netwm.cpp +++ b/kdecore/netwm.cpp @@ -629,7 +629,7 @@ NETRootInfo::NETRootInfo(Display *display, Window supportWindow, const char *wmN p->desktop_layout_columns = p->desktop_layout_rows = 0; setDefaultProperties(); if( properties_size > PROPERTIES_SIZE ) { - fprintf( stderr, "NETRootInfo::NETRootInfo(): properties array too large\n"); + fprintf( stderr, "[netwm] NETRootInfo::NETRootInfo(): properties array too large\n"); properties_size = PROPERTIES_SIZE; } for( int i = 0; i < properties_size; ++i ) @@ -730,7 +730,7 @@ NETRootInfo::NETRootInfo(Display *display, const unsigned long properties[], int p->desktop_layout_columns = p->desktop_layout_rows = 0; setDefaultProperties(); if( properties_size > 2 ) { - fprintf( stderr, "NETWinInfo::NETWinInfo(): properties array too large\n"); + fprintf( stderr, "[netwm] NETWinInfo::NETWinInfo(): properties array too large\n"); properties_size = 2; } for( int i = 0; i < properties_size; ++i ) diff --git a/kdecore/tests/ksimpleconfigtest.cpp b/kdecore/tests/ksimpleconfigtest.cpp index 6aa93c06d..699be34cf 100644 --- a/kdecore/tests/ksimpleconfigtest.cpp +++ b/kdecore/tests/ksimpleconfigtest.cpp @@ -32,17 +32,17 @@ int main( int argc, char **argv ) aConfig.writeEntry( "akey1", "avalue1" ); aConfig.writeEntry( "akey2", "avalue2" ); - fprintf( stderr, "entries written, sleeping for 10 seconds\n" ); + fprintf( stderr, "[ksimpleconfigtest] entries written, sleeping for 10 seconds\n" ); aConfig.sync(); sleep( 10 ); aConfig.setGroup( "Test group" ); aConfig.deleteEntry( "key2", false ); - fprintf( stderr, "Deleted on entry from Test group, sleeping\n" ); + fprintf( stderr, "[ksimpleconfigtest] Deleted on entry from Test group, sleeping\n" ); aConfig.sync(); sleep( 10 ); aConfig.deleteGroup( "Another Test group", true ); - fprintf( stderr, "Deleted Another Test group\n" ); + fprintf( stderr, "[ksimpleconfigtest] Deleted Another Test group\n" ); } |