Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit afd2d34

Browse files
committed
Do not write to stderr
Log message with error level instead of writing to stderr. Stderr may not be available on embedded systems. It is better to send the messages to the logging framework.
1 parent e20cb27 commit afd2d34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/de/taimos/gpsd4java/backend/LegacyResultParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ private IGPSObject parseSUBFRAME(final JSONObject json) throws ParseException {
338338
} else if (json.has(IONOObject.NAME)) {
339339
subframe.setIono((IONOObject) this.parse(json.optJSONObject(IONOObject.NAME)));
340340
} else {
341-
System.err.println("Unknown subframe: " + json.toString());
341+
AbstractResultParser.LOG.error("Unknown subframe: {}", json.toString());
342342
}
343343
gps = subframe;
344344
return gps;

src/main/java/de/taimos/gpsd4java/backend/ResultParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ private IGPSObject parseSUBFRAME(final JSONObject json) throws ParseException {
339339
} else if (json.has(IONOObject.NAME)) {
340340
subframe.setIono((IONOObject) this.parse(json.optJSONObject(IONOObject.NAME)));
341341
} else {
342-
System.err.println("Unknown subframe: " + json.toString());
342+
AbstractResultParser.LOG.error("Unknown subframe: {}", json.toString());
343343
}
344344
gps = subframe;
345345
return gps;

0 commit comments

Comments
 (0)