From bb225f9eadb94e5e80afdde652ed6aeccaeab7de Mon Sep 17 00:00:00 2001 From: ericwa Date: Mon, 11 Jul 2011 18:16:45 +0000 Subject: [PATCH] * Source/GSGhostscriptImageRep.m: Change to NSLog, only log a warning the first time invoking ghostscript throws an exception, and log a message if it returns a nonzero exit status. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33527 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/GSGhostscriptImageRep.m | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82227d238..139b04752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-07-11 Eric Wasylishen + + * Source/GSGhostscriptImageRep.m: Change to NSLog, only log + a warning the first time invoking ghostscript throws an exception, + and log a message if it returns a nonzero exit status. + 2011-07-11 Eric Wasylishen * Source/GSGhostscriptImageRep.m: Add NSWarnLog to execption diff --git a/Source/GSGhostscriptImageRep.m b/Source/GSGhostscriptImageRep.m index e7b528a25..ffc4bfbfd 100644 --- a/Source/GSGhostscriptImageRep.m +++ b/Source/GSGhostscriptImageRep.m @@ -134,7 +134,7 @@ if (!warned) { warned = YES; - NSWarnLog(@"An error occurred while determining the Ghostscript executable path. If you would like to use Ghostscript you can set the GSGhostscriptExecutablePath user default to the full path to the gs executable."); + NSLog(@"An error occurred while determining the Ghostscript executable path. If you would like to use Ghostscript you can set the GSGhostscriptExecutablePath user default to the full path to the gs executable."); } } NS_ENDHANDLER @@ -176,10 +176,20 @@ result = [outputHandle readDataToEndOfFile]; [outputHandle closeFile]; + + if (![task isRunning] && [task terminationStatus] != 0) + { + NSLog(@"Ghostscript returned exit status %d", [task terminationStatus]); + } } NS_HANDLER { - NSWarnLog(@"An error occurred while attempting to invoke Ghostscript at the following path: %@", launchPath); + static BOOL warned = NO; + if (!warned) + { + warned = YES; + NSLog(@"An error occurred while attempting to invoke Ghostscript at the following path: %@", launchPath); + } } NS_ENDHANDLER