X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fmarkdown%2Fhtml%2FSCLDocumentationExtensionNodeHandler.java;h=d9e65e28c39208b575234aae41e3a94000702912;hp=bec138283039b19b42582922c70cf9aec23a717f;hb=1dfeb7d5c49b1391cd9d877e1eddab18995cb151;hpb=c13c4179bda758e77fe1f2032d3c4268bb9e3120 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java index bec138283..d9e65e28c 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java @@ -23,6 +23,8 @@ import org.simantics.scl.compiler.types.TPred; import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.util.TypeUnparsingContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import gnu.trove.map.hash.THashMap; import gnu.trove.procedure.TObjectProcedure; @@ -30,6 +32,7 @@ import gnu.trove.set.hash.THashSet; public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandler { + private static final Logger LOGGER = LoggerFactory.getLogger(SCLDocumentationExtensionNodeHandler.class); final ModuleRepository moduleRepository; final String documentationName; @@ -56,7 +59,7 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle if(name.isEmpty()) continue; if(!documentedValues.add(name)) - System.err.println("Value '" + name + "' has already been documented in " + documentationName + "."); + LOGGER.warn("Value '" + name + "' has already been documented in " + documentationName + "."); generateValueDocumentation(container, name); } return container; @@ -69,7 +72,7 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle if(name.isEmpty()) continue; if(!documentedClasses.add(name)) - System.err.println("Class '" + name + "' has already been documented in " + documentationName + "."); + LOGGER.warn("Class '" + name + "' has already been documented in " + documentationName + "."); generateClassDocumentation(container, name); } return container; @@ -82,7 +85,7 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle if(name.isEmpty()) continue; if(!documentedTypeConstructors.add(name)) - System.err.println("Type constructor '" + name + "' has already been documented in " + documentationName + "."); + LOGGER.warn("Type constructor '" + name + "' has already been documented in " + documentationName + "."); generateDataDocumentation(container, name); } return container; @@ -122,7 +125,7 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle if(relatedModule == null) { relatedModule = moduleRepository.getModule(documentationName); if(!relatedModule.didSucceed()) - System.err.println("Couldn't load the module " + documentationName); + LOGGER.warn("Couldn't load the module " + documentationName); } if(relatedModule.didSucceed()) return relatedModule.getResult(); @@ -136,7 +139,7 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle fm = moduleRepository.getModule(moduleName); moduleCache.put(moduleName, fm); if(!fm.didSucceed()) - System.err.println("Couldn't load the module " + moduleName); + LOGGER.warn("Couldn't load the module " + moduleName); } if(fm.didSucceed()) return fm.getResult(); @@ -165,12 +168,12 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle if(value == null) { StringBuilder error = new StringBuilder(); error.append("Didn't find the value '" + name + "'."); - System.err.println(error); + LOGGER.error(error.toString()); container.addChild(new CodeBlockNode(error)); return; } if(value.isPrivate()) - System.err.println("Documentation " + documentationName + " refers to a private value " + name + "."); + LOGGER.warn("Documentation " + documentationName + " refers to a private value " + name + "."); StringBuilder signature = new StringBuilder(); signature.append("
")); } @@ -221,7 +224,7 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle if(typeClass == null) { StringBuilder error = new StringBuilder(); error.append("Didn't find the type class '" + name + "'."); - System.err.println(error); + LOGGER.error(error.toString()); container.addChild(new CodeBlockNode(error)); return; } @@ -255,11 +258,11 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle container.addChild(parser.parseDocument(typeClass.documentation)); } else - System.out.println(name); + LOGGER.info(name); for(String methodName : typeClass.methodNames) { if(!documentedValues.add(methodName)) - System.err.println("Method '" + methodName + "' has already been documented in " + documentationName + "."); + LOGGER.warn("Method '" + methodName + "' has already been documented in " + documentationName + "."); generateValueDocumentation(container, module, methodName, new TypeUnparsingContext(tuc)); } container.addChild(new HtmlNode("")); @@ -311,12 +314,12 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle container.addChild(parser.parseDocument(typeDescriptor.getDocumentation())); } else - System.out.println(name); + LOGGER.info(name); if(typeDescriptor instanceof TypeConstructor) { for(Constructor constructor : ((TypeConstructor)typeDescriptor).constructors) { if(!documentedValues.add(constructor.name.name)) - System.err.println("Method '" + constructor.name.name + "' has already been documented in " + documentationName + "."); + LOGGER.warn("Method '" + constructor.name.name + "' has already been documented in " + documentationName + "."); generateValueDocumentation(container, module, constructor.name.name, new TypeUnparsingContext(tuc)); } }