diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2012-03-07 17:22:58 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2012-03-07 17:22:58 -0600 |
commit | e15521d96b21cb0c771cce7cbe2ceb38f27c8844 (patch) | |
tree | d70ae645d1e414273f12736df3589cc96fdeebda /tdecore | |
parent | 563d4ecebe282b0062cbdb74413ef960401a25bf (diff) | |
download | tdelibs-e15521d96b21cb0c771cce7cbe2ceb38f27c8844.tar.gz tdelibs-e15521d96b21cb0c771cce7cbe2ceb38f27c8844.zip |
Add source code module name to stdout/stderr messages to improve readability.
Diffstat (limited to 'tdecore')
-rw-r--r-- | tdecore/kcrash.cpp | 30 | ||||
-rw-r--r-- | tdecore/netwm.cpp | 4 | ||||
-rw-r--r-- | tdecore/tests/ksimpleconfigtest.cpp | 6 |
3 files changed, 20 insertions, 20 deletions
diff --git a/tdecore/kcrash.cpp b/tdecore/kcrash.cpp index 0b3d615ff..4596a73ca 100644 --- a/tdecore/kcrash.cpp +++ b/tdecore/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; } @@ -320,7 +320,7 @@ void KCrash::startDrKonqi( const char* argv[], int argc ) // If we can't reach tdeinit we can still at least try to fork() void KCrash::startDirectly( const char* argv[], int ) { - fprintf( stderr, "KCrash cannot reach tdeinit, launching directly.\n" ); + fprintf( stderr, "[kcrash] KCrash cannot reach tdeinit, launching directly.\n" ); pid_t pid = fork(); if (pid <= 0) { @@ -451,12 +451,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++; @@ -473,7 +473,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'; @@ -482,13 +482,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("/tdeinit_")+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; } @@ -498,7 +498,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; } @@ -508,7 +508,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; } @@ -517,7 +517,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/tdecore/netwm.cpp b/tdecore/netwm.cpp index 455b6db65..bc352c8bc 100644 --- a/tdecore/netwm.cpp +++ b/tdecore/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/tdecore/tests/ksimpleconfigtest.cpp b/tdecore/tests/ksimpleconfigtest.cpp index 6aa93c06d..699be34cf 100644 --- a/tdecore/tests/ksimpleconfigtest.cpp +++ b/tdecore/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" ); } |