本文整理汇总了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();
}
示例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");
}
示例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);
}
示例4: getLogFor
import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
public static Log getLogFor(Class<?> type) {
return new Log(Logger.getLoggerFor(type));
}
示例5: Log
import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
public Log(Logger logger) {
this.logger = logger;
}
示例6: tearDown
import com.thoughtworks.go.plugin.api.logging.Logger; //导入依赖的package包/类
@After
public void tearDown() throws Exception {
Logger.initialize(null);
}