use of io.bootique.log.BootLogger in project tutorials by eugenp.
the class App method main.
public static void main(String[] args) {
Module module = binder -> JerseyModule.extend(binder).addResource(IndexController.class).addResource(SaveController.class);
Bootique.app(args).module(module).module(ModuleBinder.class).bootLogger(new BootLogger() {
@Override
public void trace(Supplier<String> arg0) {
// ...
}
@Override
public void stdout(String arg0) {
// ...
}
@Override
public void stderr(String arg0, Throwable arg1) {
// ...
}
@Override
public void stderr(String arg0) {
// ...
}
}).autoLoadModules().exec();
}
use of io.bootique.log.BootLogger in project bootique-jdbc by bootique.
the class JdbcTestModuleIT method testListeners_Injected.
@Test
public void testListeners_Injected() {
BQRuntime runtime = TEST_FACTORY.app("-c", "classpath:io/bootique/jdbc/test/dummy-ds.yml").autoLoadModules().module(new Module() {
@Override
public void configure(Binder binder) {
JdbcModule.extend(binder).addDataSourceListener(TestDataSourceListener3.class).addDataSourceListener(TestDataSourceListener4.class);
}
@Singleton
@Provides
TestDataSourceListener3 provideListener3(BootLogger bootLogger) {
return new TestDataSourceListener3();
}
@Singleton
@Provides
TestDataSourceListener4 provideListener4(BootLogger bootLogger) {
return new TestDataSourceListener4();
}
}).createRuntime();
TypeLiteral<Set<io.bootique.jdbc.DataSourceListener>> typeLiteral = new TypeLiteral<Set<io.bootique.jdbc.DataSourceListener>>() {
};
Set<io.bootique.jdbc.DataSourceListener> set = runtime.getInstance(Key.get(typeLiteral));
assertEquals(set.size(), 3);
}
Aggregations