freemarker.log.Logger.selectLoggerLibrary()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(234)

本文整理了Java中freemarker.log.Logger.selectLoggerLibrary()方法的一些代码示例,展示了Logger.selectLoggerLibrary()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.selectLoggerLibrary()方法的具体详情如下:
包路径:freemarker.log.Logger
类名称:Logger
方法名:selectLoggerLibrary

Logger.selectLoggerLibrary介绍

[英]Selects the logger library to use, unless it's already specified by the #SYSTEM_PROPERTY_NAME_LOGGER_LIBRARY system property. Call this early in application initialization phase, before calling any other FreeMarker API-s, since once parts of the FreeMarker library bind to the logging subsystem, the change in this value will have no effect on them.
[中]选择要使用的记录器库,除非已由#SYSTEM_PROPERTY_NAME_logger_library SYSTEM属性指定。在应用程序初始化阶段的早期调用此函数,然后再调用任何其他FreeMarker API-s,因为一旦FreeMarker库的部分绑定到日志子系统,此值的更改将不会对它们产生影响。

代码示例

代码示例来源:origin: org.uberfire/uberfire-workbench-processors

protected AbstractErrorAbsorbingProcessor() {
  try {
    freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
  } catch (ClassNotFoundException e) {
    rememberedInitError = e;
  }
}

代码示例来源:origin: kiegroup/appformer

protected AbstractErrorAbsorbingProcessor() {
  try {
    freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
  } catch (ClassNotFoundException e) {
    rememberedInitError = e;
  }
}

代码示例来源:origin: apache/stanbol

@Override
public void start(BundleContext context) throws Exception {
  Logger.selectLoggerLibrary(Logger.LIBRARY_SLF4J);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-libs-freemarker

public FreemarkerEngine(ScriptEngineFactory factory) {
  this.factory = factory;
  try {
    freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_JAVA);
  } catch (ClassNotFoundException ex) {
    try {
      freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
    } catch (ClassNotFoundException ex1) {
      Exceptions.printStackTrace(ex1);
    }
  }
}

代码示例来源:origin: yuchenggroup/rapid-generator

public static void main(String[] args) throws Exception {
  //disable freemarker logging
  freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
  
  startProcess();
}

代码示例来源:origin: com.hazelcast/hazelcast-code-generator

@Override
public void init(ProcessingEnvironment env) {
  filer = env.getFiler();
  messager = env.getMessager();
  elementUtils = env.getElementUtils();
  try {
    Logger.selectLoggerLibrary(Logger.LIBRARY_NONE);
  } catch (ClassNotFoundException e) {
    messager.printMessage(Diagnostic.Kind.ERROR, e.getMessage());
  }
  Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
  cfg.setTemplateLoader(new ClassTemplateLoader(getClass(), "/"));
  try {
    messageFactoryTemplate = cfg.getTemplate("messagefactory-template-java.ftl");
  } catch (IOException e) {
    messager.printMessage(Diagnostic.Kind.ERROR, e.getMessage());
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-batch

public void writeToFile(IssuesReport report, File toFile, boolean complete) {
 try {
  freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
  freemarker.template.Configuration cfg = new freemarker.template.Configuration();
  cfg.setClassForTemplateLoading(HtmlReport.class, "");
  Map<String, Object> root = Maps.newHashMap();
  root.put("report", report);
  root.put("ruleNameProvider", ruleNameProvider);
  root.put("sourceProvider", sourceProvider);
  root.put("complete", complete);
  Template template = cfg.getTemplate("issuesreport.ftl");
  try (FileOutputStream fos = new FileOutputStream(toFile); Writer writer = new OutputStreamWriter(fos, fs.encoding())) {
   template.process(root, writer);
   writer.flush();
  }
 } catch (Exception e) {
  throw new IllegalStateException("Fail to generate HTML Issues Report to: " + toFile, e);
 }
}

代码示例来源:origin: org.codehaus.sonar-plugins/sonar-issues-report-plugin

public void writeToFile(IssuesReport report, File toFile, boolean complete) {
 Writer writer = null;
 FileOutputStream fos = null;
 try {
  Logger.selectLoggerLibrary(Logger.LIBRARY_NONE);
  freemarker.template.Configuration cfg = new freemarker.template.Configuration();
  cfg.setClassForTemplateLoading(HtmlPrinter.class, "");
  Map<String, Object> root = Maps.newHashMap();
  root.put("report", report);
  root.put("ruleNameProvider", ruleNameProvider);
  root.put("sourceProvider", sourceProvider);
  root.put("complete", complete);
  Template template = cfg.getTemplate("issuesreport.ftl");
  fos = new FileOutputStream(toFile);
  writer = new OutputStreamWriter(fos, fs.sourceCharset());
  template.process(root, writer);
  writer.flush();
 } catch (Exception e) {
  throw new IllegalStateException("Fail to generate HTML Issues Report to: " + toFile, e);
 } finally {
  IOUtils.closeQuietly(writer);
  IOUtils.closeQuietly(fos);
 }
}

代码示例来源:origin: org.codehaus.sonar/sonar-batch

public void writeToFile(IssuesReport report, File toFile, boolean complete) {
 Writer writer = null;
 FileOutputStream fos = null;
 try {
  freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
  freemarker.template.Configuration cfg = new freemarker.template.Configuration();
  cfg.setClassForTemplateLoading(HtmlReport.class, "");
  Map<String, Object> root = Maps.newHashMap();
  root.put("report", report);
  root.put("ruleNameProvider", ruleNameProvider);
  root.put("sourceProvider", sourceProvider);
  root.put("complete", complete);
  Template template = cfg.getTemplate("issuesreport.ftl");
  fos = new FileOutputStream(toFile);
  writer = new OutputStreamWriter(fos, fs.encoding());
  template.process(root, writer);
  writer.flush();
 } catch (Exception e) {
  throw new IllegalStateException("Fail to generate HTML Issues Report to: " + toFile, e);
 } finally {
  IOUtils.closeQuietly(writer);
  IOUtils.closeQuietly(fos);
 }
}

代码示例来源:origin: org.freemarker/com.springsource.freemarker

try
  selectLoggerLibrary(LIBRARY_AUTO);

代码示例来源:origin: com.googlecode.rapid-framework/rapid-generator-ext

protected void executeInternal() throws Exception {
  freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
  
  executeBefore();
  
  GeneratorFacade facade = createGeneratorFacade(input,output);
  
  List<Map> maps = getGeneratorContexts();
  if(maps == null) return;
  for(Map map : maps) {
    facade.generateByMap(map);
  }
  
  if(openOutputDir && SystemHelper.isWindowsOS) {
    Runtime.getRuntime().exec("cmd.exe /c start "+output);
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-code-generator

elementUtils = env.getElementUtils();
try {
  Logger.selectLoggerLibrary(Logger.LIBRARY_NONE);
} catch (ClassNotFoundException e) {
  messager.printMessage(Diagnostic.Kind.ERROR, e.getMessage());

代码示例来源:origin: net.sourceforge.schemacrawler/schemacrawler

.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_JAVA);

代码示例来源:origin: net.sourceforge.fmpp/fmpp

Logger.selectLoggerLibrary(Logger.LIBRARY_NONE);
} catch (ClassNotFoundException e) {
  throw new RuntimeExceptionCC(

代码示例来源:origin: net.sourceforge.fmpp/fmpp

Logger.selectLoggerLibrary(Logger.LIBRARY_NONE);
} catch (ClassNotFoundException e) {
  throw new RuntimeExceptionCC(

相关文章