* if true then the build was successfull, false if not successfull
* @param msg
* optional additional message
*/
private static void createModuleLog(boolean success, String msg) {
final ModuleLog ml = OBProvider.getInstance().get(ModuleLog.class);
ml.setAction("B");
if (success) {
ml.setLog("Build successfull");
} else {
final int prefixLength = "Build failed, message: ".length();
final int maxMsgLength = 2000 - prefixLength;
if (msg == null) {
ml.setLog("Build failed");
} else if (msg.length() > maxMsgLength) {
ml.setLog("Build failed, message: " + msg.substring(0, maxMsgLength));
} else {
ml.setLog("Build failed, message: " + msg);
}
}
OBDal.getInstance().save(ml);
}