Skip to content

Commit

Permalink
Re: Jim and Logan Logging level fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Jan 23, 2025
1 parent 8e5fdc5 commit 9cb0f33
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public static int executeVCellBiosimulationsMode(File inFile, File outDir, boole
}
LoggerContext config = (LoggerContext)(LogManager.getContext(false));
config.getConfiguration().getLoggerConfig(LogManager.getLogger("org.vcell").getName()).setLevel(logLevel);
config.getConfiguration().getLoggerConfig(LogManager.getLogger("cbit").getName()).setLevel(logLevel);

config.getConfiguration().getLoggerConfig(LogManager.getLogger("cbit").getName()).setLevel(!bDebug ? Level.WARN : logLevel);
config.getConfiguration().getLoggerConfig(LogManager.getLogger("org.jlibsedml").getName()).setLevel(!bDebug ? Level.WARN : logLevel);
config.updateLoggers();

logger.debug("Biosimulations mode requested");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static GeometricRegion[] getUpdatedGeometricRegions(GeometrySurfaceDescri
cbit.vcell.geometry.RegionImage.RegionInfo regionInfos[] = regionImage.getRegionInfos();
for(int i = 0; i < regionInfos.length; i++){
cbit.vcell.geometry.RegionImage.RegionInfo regionInfo = regionInfos[i];
if (lg.isDebugEnabled()) lg.info(regionInfo);
lg.info(regionInfo);
cbit.vcell.geometry.SubVolume subVolume = geometrySpec.getSubVolume(regionInfo.getPixelValue());
String name = subVolume.getName() + regionInfo.getRegionIndex();
int numPixels = regionInfo.getNumPixels();
Expand Down Expand Up @@ -214,15 +214,15 @@ public static GeometricRegion[] getUpdatedGeometricRegions(GeometrySurfaceDescri
}

size -= sizeOfPixel * 0.125 * numOctantsToRemove;
if(lg.isDebugEnabled()) lg.info("size={}", size);
lg.debug("size={}", size);

break;
}
}

VolumeGeometricRegion volumeRegion = new VolumeGeometricRegion(name, size, volumeUnit, subVolume, regionInfo.getRegionIndex());
regionList.add(volumeRegion);
if(lg.isDebugEnabled()) lg.info("added volumeRegion({})", volumeRegion.getName());
lg.info("added volumeRegion({})", volumeRegion.getName());

}
//
Expand Down Expand Up @@ -266,7 +266,7 @@ public static GeometricRegion[] getUpdatedGeometricRegions(GeometrySurfaceDescri
}
surfaceRegion.addAdjacentGeometricRegion(interiorVolumeRegion);
interiorVolumeRegion.addAdjacentGeometricRegion(surfaceRegion);
if(lg.isDebugEnabled()) lg.info("added surfaceRegion({})", surfaceRegion.getName());
lg.info("added surfaceRegion({})", surfaceRegion.getName());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ private void refreshMathDescription() throws MappingException, MatrixException,
for(int i = 0; i < mappedSMs.length; i++){
if(mappedSMs[i] instanceof FeatureMapping){
if(mappedFM != null){
if (lg.isDebugEnabled()) lg.warn("WARNING:::: MathMapping.refreshMathDescription() ... assigning boundary condition types not unique");
lg.info("WARNING:::: MathMapping.refreshMathDescription() ... assigning boundary condition types not unique");
}
mappedFM = (FeatureMapping) mappedSMs[i];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ protected void refreshMathDescription() throws MappingException, MatrixException
for (int i = 0; i < mappedSMs.length; i++) {
if (mappedSMs[i] instanceof FeatureMapping){
if (mappedFM!=null){
if (lg.isDebugEnabled()) lg.warn("WARNING:::: MathMapping.refreshMathDescription() ... assigning boundary condition types not unique");
lg.info("WARNING:::: MathMapping.refreshMathDescription() ... assigning boundary condition types not unique");
}
mappedFM = (FeatureMapping)mappedSMs[i];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ private void refreshMathDescription() throws MappingException, MatrixException,
for (int i = 0; i < mappedSMs.length; i++) {
if (mappedSMs[i] instanceof FeatureMapping){
if (mappedFM!=null){
if (lg.isDebugEnabled()) lg.warn("WARNING:::: MathMapping.refreshMathDescription() ... assigning boundary condition types not unique");
lg.info("WARNING:::: MathMapping.refreshMathDescription() ... assigning boundary condition types not unique");
}
mappedFM = (FeatureMapping)mappedSMs[i];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ private static List<SolverDescription> matchByKisaoId(KisaoTerm candidate) {
for (SolverDescription sd : SolverDescription.values()) {
if (sd.getKisao().contains(":") || sd.getKisao().contains("_")) {
logger.trace(sd.getKisao());
} else if ("KISAO".equals(sd.getKisao())){
logger.info("Skipping not-yet-created KiSAO term");
} else {
if (logger.isDebugEnabled()) logger.warn("`{}` is bad KiSAO formating, skipping", sd.getKisao());
logger.warn("`{}` is bad KiSAO formating, skipping", sd.getKisao());
continue;
}
String s1 = candidate.getId();
Expand Down
2 changes: 1 addition & 1 deletion vcell-core/src/main/java/cbit/vcell/xml/XmlReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -4562,7 +4562,7 @@ public Model getModel(Element param) throws XmlParseException{
if(element != null){
getRbmModelContainer(element, newmodel);
} else {
if (lg.isDebugEnabled()) lg.info("RbmModelContainer is missing.");
lg.info("RbmModelContainer is missing.");
}

//Add SpeciesContexts
Expand Down
2 changes: 1 addition & 1 deletion vcell-core/src/main/java/org/jlibsedml/SEDMLReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Algorithm getAlgorithm(Element algorithmElement) {
if (eChild.getName().equals(SEDMLTags.ALGORITHM_PARAMETER_LIST)) {
addAlgorithmParameters(alg, eChild);
} else {
if (log.isDebugEnabled()) log.warn("Unexpected " + eChild);
log.warn("Unexpected " + eChild);
}
}
return alg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private String getSchema(String xmlAsString) throws JDOMException,
return SEDML_L1_V2_SCHEMA;
} else {
// probably level 3, but trying anyway to interpret with level 2
if (log.isDebugEnabled()) log.warn("SED-ML version level not supported, import may fail");
log.info("WARNING: SED-ML version level not supported, import may fail");
return SEDML_L1_V3_SCHEMA;
// throw new IllegalArgumentException(
// "Invalid level/version combingation - must be 1-1 or 1-2 but was "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private String getSchematronXSL() {
} else if (sedml.isL1V2()) {
return "validatorl1v2.xsl";
} else {
if (lg.isDebugEnabled()) lg.warn("Unsupported version, import may fail");
lg.warn("Unsupported version, import may fail");
return "validatorl1v2.xsl";
// throw new UnsupportedOperationException(MessageFormat.format(
// "Invalid level and version - {0}-{1}", sedml.getLevel(),
Expand Down
10 changes: 4 additions & 6 deletions vcell-core/src/main/java/org/vcell/sedml/SEDMLImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public List<BioModel> getBioModels() {
// try to find a match in the ontology tree
SolverDescription solverDescription = SolverUtilities.matchSolverWithKisaoId(kisaoID, this.exactMatchOnly);
if (solverDescription != null) {
if (logger.isDebugEnabled()) logger.info("Task (id='{}') is compatible, solver match found in ontology: '{}' matched to {}", selectedTask.getId(), kisaoID, solverDescription);
logger.info("Task (id='{}') is compatible, solver match found in ontology: '{}' matched to {}", selectedTask.getId(), kisaoID, solverDescription);
} else {
// give it a try anyway with our deterministic default solver
solverDescription = SolverDescription.CombinedSundials;
Expand Down Expand Up @@ -441,12 +441,10 @@ private List<BioModel> mergeBioModels(List<BioModel> bioModels) {

BioModel bm0 = bioModels.get(0);
for (int i = 1; i < bioModels.size(); i++) {
if (logger.isDebugEnabled())
logger.info("--------------------\ncomparing model from `{}`\n with model from `{}`\n--------------------",
bioModels.get(i), bm0);
logger.debug("--------------------\ncomparing model from `{}`\n with model from `{}`\n--------------------", bioModels.get(i), bm0);
RelationVisitor rvNotStrict = new ModelRelationVisitor(false);
boolean equivalent = bioModels.get(i).getModel().relate(bm0.getModel(),rvNotStrict);
if (logger.isDebugEnabled()) logger.info("Equivalent => {}", equivalent);
logger.debug("Equivalent => {}", equivalent);
if (!equivalent) return bioModels;
}
// all have matchable model, try to merge by pooling SimContexts
Expand Down Expand Up @@ -1087,7 +1085,7 @@ private void translateAlgorithmParams(SolverTaskDescription simTaskDesc, org.jli
NonspatialStochHybridOptions nonspatialSHO = simTaskDesc.getStochHybridOpt();
nonspatialSHO.setSDETolerance(Double.parseDouble(apValue));
} else {
logger.error("Algorithm parameter with kisao id '" + apKisaoID + "' not supported at this time, skipping.");
logger.info("WARNING: Algorithm parameter with kisao id '" + apKisaoID + "' not supported at this time, skipping.");
}
}
simTaskDesc.setErrorTolerance(errorTolerance);
Expand Down

0 comments on commit 9cb0f33

Please sign in to comment.