Eliminate use of System.out + proper error logging (#3572)
This commit is contained in:
parent
bbb771f32e
commit
bad76048d1
@ -531,13 +531,11 @@ public class Booster implements Serializable, KryoSerializable {
|
|||||||
try {
|
try {
|
||||||
byte[] serObj = this.toByteArray();
|
byte[] serObj = this.toByteArray();
|
||||||
int serObjSize = serObj.length;
|
int serObjSize = serObj.length;
|
||||||
System.out.println("==== serialized obj size " + serObjSize);
|
|
||||||
output.writeInt(serObjSize);
|
output.writeInt(serObjSize);
|
||||||
output.writeInt(version);
|
output.writeInt(version);
|
||||||
output.write(serObj);
|
output.write(serObj);
|
||||||
} catch (XGBoostError ex) {
|
} catch (XGBoostError ex) {
|
||||||
ex.printStackTrace();
|
logger.error(ex.getMessage(), ex);
|
||||||
logger.error(ex.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,13 +545,11 @@ public class Booster implements Serializable, KryoSerializable {
|
|||||||
this.init(null);
|
this.init(null);
|
||||||
int serObjSize = input.readInt();
|
int serObjSize = input.readInt();
|
||||||
this.version = input.readInt();
|
this.version = input.readInt();
|
||||||
System.out.println("==== the size of the object: " + serObjSize);
|
|
||||||
byte[] bytes = new byte[serObjSize];
|
byte[] bytes = new byte[serObjSize];
|
||||||
input.readBytes(bytes);
|
input.readBytes(bytes);
|
||||||
XGBoostJNI.checkCall(XGBoostJNI.XGBoosterLoadModelFromBuffer(this.handle, bytes));
|
XGBoostJNI.checkCall(XGBoostJNI.XGBoosterLoadModelFromBuffer(this.handle, bytes));
|
||||||
} catch (XGBoostError ex) {
|
} catch (XGBoostError ex) {
|
||||||
ex.printStackTrace();
|
logger.error(ex.getMessage(), ex);
|
||||||
logger.error(ex.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user