1616
1717package com .google .gcloud .datastore .testing ;
1818
19+ import static com .google .common .base .MoreObjects .firstNonNull ;
1920import static java .nio .charset .StandardCharsets .UTF_8 ;
2021
2122import com .google .common .base .Strings ;
@@ -259,6 +260,7 @@ public void run() {
259260 // ignore
260261 }
261262 }
263+ processLogLine (previousLine , firstNonNull (nextLine , "" ));
262264 writeLog (currentLogLevel , currentLog );
263265 }
264266
@@ -279,15 +281,17 @@ private void processLogLine(String previousLine, String nextLine) {
279281 } else {
280282 collectionMode = true ;
281283 }
282- } else if (collectionMode && currentLog .length () > LOG_LENGTH_LIMIT ) {
283- collectionMode = false ;
284284 } else if (collectionMode ) {
285- if (currentLog .length () == 0 ) {
285+ if (currentLog .length () > LOG_LENGTH_LIMIT ) {
286+ collectionMode = false ;
287+ } else if (currentLog .length () == 0 ) {
286288 // strip level out of the line
287- currentLog .append (
288- "GCD" + previousLine .split (":" , 2 )[1 ] + System .getProperty ("line.separator" ));
289+ currentLog .append ("GCD" );
290+ currentLog .append (previousLine .split (":" , 2 )[1 ]);
291+ currentLog .append (System .getProperty ("line.separator" ));
289292 } else {
290- currentLog .append (previousLine + System .getProperty ("line.separator" ));
293+ currentLog .append (previousLine );
294+ currentLog .append (System .getProperty ("line.separator" ));
291295 }
292296 }
293297 }
0 commit comments