use of java.util.logging.Logger in project j2objc by google.
the class LoggerTest method testAddHandler_Null.
/*
* Test addHandler(Handler) with a null handler.
*/
public void testAddHandler_Null() {
Logger log = Logger.getLogger("testAddHandler_Null");
try {
log.addHandler(null);
fail("Should throw NullPointerException!");
} catch (NullPointerException e) {
}
assertEquals(log.getHandlers().length, 0);
}
use of java.util.logging.Logger in project j2objc by google.
the class LoggerTest method testGetLoggerWithRes_ExistingLoggerWithNoRes.
/*
* Test getLogger(String, String) with valid resource bundle, to get an
* existing logger with no associated resource bundle.
*/
public void testGetLoggerWithRes_ExistingLoggerWithNoRes() {
assertNull(LogManager.getLogManager().getLogger("testGetLoggerWithRes_ExistingLoggerWithNoRes_ANewLogger"));
// create a new logger
Logger log1 = Logger.getLogger("testGetLoggerWithRes_ExistingLoggerWithNoRes_ANewLogger");
// get an existing logger
Logger log2 = Logger.getLogger("testGetLoggerWithRes_ExistingLoggerWithNoRes_ANewLogger", VALID_RESOURCE_BUNDLE);
assertSame(log1, log2);
assertEquals(VALID_VALUE, log1.getResourceBundle().getString(VALID_KEY));
assertEquals(log1.getResourceBundleName(), VALID_RESOURCE_BUNDLE);
}
use of java.util.logging.Logger in project groovy by apache.
the class NodePrinterTest method testLogging.
public void testLogging() {
Logger log = Logger.getLogger(getClass().getName());
log.info("Logging using JDK 1.4 logging");
}
use of java.util.logging.Logger in project camel by apache.
the class BonitaAPIUtil method getInstance.
public static BonitaAPIUtil getInstance(BonitaAPIConfig bonitaAPIConfig) {
if (instance == null) {
instance = new BonitaAPIUtil();
ClientConfig clientConfig = new ClientConfig();
clientConfig.register(MultiPartFeature.class);
clientConfig.register(JacksonJsonProvider.class);
Logger logger = Logger.getLogger("org.bonitasoft.camel.bonita.api.util.BonitaAPIUtil");
Feature feature = new LoggingFeature(logger, Level.INFO, null, null);
clientConfig.register(feature);
ClientBuilder clientBuilder = ClientBuilder.newBuilder().withConfig(clientConfig);
Client client = clientBuilder.build();
client.register(new JsonClientFilter());
client.register(new BonitaAuthFilter(bonitaAPIConfig));
instance.setWebTarget(client.target(bonitaAPIConfig.getBaseBonitaURI()));
}
return instance;
}
use of java.util.logging.Logger in project byte-buddy by raphw.
the class ByteBuddyLogHandler method initialize.
/**
* Initializes the Byte Buddy log handler.
*
* @param project The current project.
* @return The registered log handler.
*/
public static ByteBuddyLogHandler initialize(Project project) {
Logger logger = Logger.getLogger("net.bytebuddy");
ByteBuddyLogHandler handler = new ByteBuddyLogHandler(project, logger, logger.getUseParentHandlers());
try {
logger.setUseParentHandlers(false);
logger.addHandler(handler);
} catch (SecurityException exception) {
project.getLogger().warn("Cannot configure Byte Buddy logging", exception);
}
return handler;
}
Aggregations