Skip to content

Commit e73e51a

Browse files
author
volker
committed
print notarize errors to the error stream and not to the debug stream
1 parent 582f961 commit e73e51a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/com/inet/gradle/appbundler/OSXNotarize.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import java.util.ArrayList;
77
import java.util.List;
88
import java.util.Map;
9-
import java.util.stream.Collectors;
109

1110
import org.gradle.api.internal.file.FileResolver;
11+
import org.gradle.api.logging.Logger;
1212

1313
import com.inet.gradle.appbundler.utils.xmlwise.Plist;
1414
import com.inet.gradle.appbundler.utils.xmlwise.XmlParseException;
@@ -167,30 +167,31 @@ private String requestNotarization( File notarizeFile ) {
167167
ByteArrayOutputStream error = new ByteArrayOutputStream();
168168
String output = exec( true, error, command.toArray( new String[command.size()] ) );
169169
if( isDebugOutput() ) {
170-
task.getProject().getLogger().debug( output );
170+
task.getProject().getLogger().lifecycle( output );
171171
}
172172

173173
try {
174174
Map<String, Object> plist = Plist.fromXml( output );
175175
return (String)plist.get( "id" );
176176
} catch( ClassCastException | XmlParseException e ) {
177-
task.getProject().getLogger().error( "An error occured while checking the noraization response." );
177+
Logger logger = task.getProject().getLogger();
178+
logger.error( "An error occured while checking the noraization response." );
178179
if( !isDebugOutput() ) {
179180
// Debug in addition
180-
task.getProject().getLogger().error( "Debug output START:" );
181-
task.getProject().getLogger().error( output );
182-
task.getProject().getLogger().error( "Debug output END" );
181+
logger.error( "Debug output START:" );
182+
logger.error( output );
183+
logger.error( "Debug output END" );
183184
}
184185

185-
task.getProject().getLogger().debug( "The Error stream produced:" );
186-
task.getProject().getLogger().debug( error.toString() );
186+
logger.error( "The Error stream produced:" );
187+
logger.error( error.toString() );
187188

188189
ByteArrayOutputStream bos = new ByteArrayOutputStream();
189190
PrintStream stream = new PrintStream( bos );
190191
e.printStackTrace( stream );
191-
task.getProject().getLogger().debug( "This is the exception it produced:" );
192-
task.getProject().getLogger().debug( bos.toString() );
193-
task.getProject().getLogger().debug( "End of Output." );
192+
logger.error( "This is the exception it produced:" );
193+
logger.error( bos.toString() );
194+
logger.error( "End of Output." );
194195
}
195196

196197
return null;

0 commit comments

Comments
 (0)