From bad76048d17c55a8ddd9700f636dbc256f48fb2c Mon Sep 17 00:00:00 2001 From: Matthew Tovbin Date: Thu, 9 Aug 2018 10:06:17 -0700 Subject: [PATCH] Eliminate use of System.out + proper error logging (#3572) --- .../src/main/java/ml/dmlc/xgboost4j/java/Booster.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/Booster.java b/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/Booster.java index 91fc2cb4d..0faa6bb58 100644 --- a/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/Booster.java +++ b/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/Booster.java @@ -531,13 +531,11 @@ public class Booster implements Serializable, KryoSerializable { try { byte[] serObj = this.toByteArray(); int serObjSize = serObj.length; - System.out.println("==== serialized obj size " + serObjSize); output.writeInt(serObjSize); output.writeInt(version); output.write(serObj); } catch (XGBoostError ex) { - ex.printStackTrace(); - logger.error(ex.getMessage()); + logger.error(ex.getMessage(), ex); } } @@ -547,13 +545,11 @@ public class Booster implements Serializable, KryoSerializable { this.init(null); int serObjSize = input.readInt(); this.version = input.readInt(); - System.out.println("==== the size of the object: " + serObjSize); byte[] bytes = new byte[serObjSize]; input.readBytes(bytes); XGBoostJNI.checkCall(XGBoostJNI.XGBoosterLoadModelFromBuffer(this.handle, bytes)); } catch (XGBoostError ex) { - ex.printStackTrace(); - logger.error(ex.getMessage()); + logger.error(ex.getMessage(), ex); } } }