当前位置: 首页>>代码示例>>Java>>正文


Java Logger类代码示例

本文整理汇总了Java中com.thoughtworks.go.plugin.api.logging.Logger的典型用法代码示例。如果您正苦于以下问题:Java Logger类的具体用法?Java Logger怎么用?Java Logger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Logger类属于com.thoughtworks.go.plugin.api.logging包,在下文中一共展示了Logger类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
@Override
public void start(BundleContext bundleContext) throws Exception {
    Bundle bundle = bundleContext.getBundle();
    pluginId = bundle.getSymbolicName();
    pluginHealthService = bundleContext.getService(bundleContext.getServiceReference(PluginHealthService.class));

    LoggingService loggingService = bundleContext.getService(bundleContext.getServiceReference(LoggingService.class));
    Logger.initialize(loggingService);

    getImplementersAndRegister(bundleContext, bundle);

    reportErrorsToHealthService();
}
 
开发者ID:gocd,项目名称:gocd,代码行数:14,代码来源:DefaultGoPluginActivator.java

示例2: shouldSetupTheLoggerWithTheLoggingServiceAndPluginId

import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
@Test
public void shouldSetupTheLoggerWithTheLoggingServiceAndPluginId() throws Exception {
    setupClassesInBundle();

    activator.start(context);

    Logger logger = Logger.getLoggerFor(DefaultGoPluginActivatorTest.class);
    logger.info("INFO");

    verify(loggingService).info(PLUGIN_ID, DefaultGoPluginActivatorTest.class.getName(), "INFO");
}
 
开发者ID:gocd,项目名称:gocd,代码行数:12,代码来源:DefaultGoPluginActivatorTest.java

示例3: logException

import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
protected void logException(Logger logger, Throwable throwable) throws UnsupportedEncodingException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    throwable.printStackTrace(new PrintStream(baos));
    String output = baos.toString(StandardCharsets.UTF_8.name());
    logger.error(throwable + "\n" + output);
}
 
开发者ID:Haufe-Lexware,项目名称:gocd-plugins,代码行数:7,代码来源:TaskExecutor.java

示例4: getLogFor

import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
public static Log getLogFor(Class<?> type) {
    return new Log(Logger.getLoggerFor(type));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:4,代码来源:Log.java

示例5: Log

import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
public Log(Logger logger) {
    this.logger = logger;
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:4,代码来源:Log.java

示例6: tearDown

import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
@After
public void tearDown() throws Exception {
    Logger.initialize(null);
}
 
开发者ID:gocd,项目名称:gocd,代码行数:5,代码来源:DefaultGoPluginActivatorTest.java


注:本文中的com.thoughtworks.go.plugin.api.logging.Logger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。