本文整理汇总了Java中com.puppycrawl.tools.checkstyle.DefaultLogger类的典型用法代码示例。如果您正苦于以下问题:Java DefaultLogger类的具体用法?Java DefaultLogger怎么用?Java DefaultLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultLogger类属于com.puppycrawl.tools.checkstyle包,在下文中一共展示了DefaultLogger类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MailLogger
import com.puppycrawl.tools.checkstyle.DefaultLogger; //导入依赖的package包/类
/**
* Constructs a <code>MailLogger</code>
*/
public MailLogger()
{
mOutputStream = new ByteArrayOutputStream();
mLogger = new DefaultLogger(mOutputStream, false);
mErrors = 0;
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:MailLogger.java
示例2: getListeners
import com.puppycrawl.tools.checkstyle.DefaultLogger; //导入依赖的package包/类
/**
* Return the list of listeners set in this task.
* @return the list of listeners.
*/
private AuditListener[] getListeners() {
final int formatterCount = Math.max(1, formatters.size());
final AuditListener[] listeners = new AuditListener[formatterCount];
// formatters
try {
if (formatters.isEmpty()) {
final OutputStream debug = new LogOutputStream(this, Project.MSG_DEBUG);
final OutputStream err = new LogOutputStream(this, Project.MSG_ERR);
listeners[0] = new DefaultLogger(debug, AutomaticBean.OutputStreamOptions.CLOSE,
err, AutomaticBean.OutputStreamOptions.CLOSE);
}
else {
for (int i = 0; i < formatterCount; i++) {
final Formatter formatter = formatters.get(i);
listeners[i] = formatter.createListener(this);
}
}
}
catch (IOException ex) {
throw new BuildException(String.format(Locale.ROOT, "Unable to create listeners: "
+ "formatters {%s}.", formatters), ex);
}
return listeners;
}
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:31,代码来源:CheckstyleAntTask.java
示例3: testDefaultLoggerListener
import com.puppycrawl.tools.checkstyle.DefaultLogger; //导入依赖的package包/类
@Test
public void testDefaultLoggerListener() throws IOException {
final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter();
formatter.setUseFile(false);
assertTrue("Listener instance has unexpected type",
formatter.createListener(null) instanceof DefaultLogger);
}
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:8,代码来源:CheckstyleAntTaskTest.java
示例4: testDefaultLoggerListenerWithToFile
import com.puppycrawl.tools.checkstyle.DefaultLogger; //导入依赖的package包/类
@Test
public void testDefaultLoggerListenerWithToFile() throws IOException {
final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter();
formatter.setUseFile(false);
formatter.setTofile(new File("target/"));
assertTrue("Listener instance has unexpected type",
formatter.createListener(null) instanceof DefaultLogger);
}
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:9,代码来源:CheckstyleAntTaskTest.java
示例5: testIsAuditListener
import com.puppycrawl.tools.checkstyle.DefaultLogger; //导入依赖的package包/类
@Test
public void testIsAuditListener() {
assertTrue("Should return true when valid checkstyle AuditListener module is passed",
ModuleReflectionUtils.isAuditListener(DefaultLogger.class));
assertFalse("Should return false when invalid class is passed",
ModuleReflectionUtils.isAuditListener(NotCheckstyleCheck.class));
}
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:8,代码来源:ModuleReflectionUtilsTest.java
示例6: setup
import com.puppycrawl.tools.checkstyle.DefaultLogger; //导入依赖的package包/类
@Before
public void setup() throws CheckstyleException {
baos = new ByteArrayOutputStream();
final AuditListener listener = new DefaultLogger(baos, OutputStreamOptions.NONE);
final InputSource inputSource = new InputSource(CheckstyleTest.class.getClassLoader().getResourceAsStream(
"checkstyle-logging.xml"));
final Configuration configuration = ConfigurationLoader.loadConfiguration(inputSource,
new PropertiesExpander(System.getProperties()), IgnoredModulesOptions.EXECUTE);
checker = new Checker();
checker.setModuleClassLoader(Checker.class.getClassLoader());
checker.configure(configuration);
checker.addListener(listener);
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:16,代码来源:CheckstyleTest.java
注:本文中的com.puppycrawl.tools.checkstyle.DefaultLogger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论