Search in sources :

Example 1 with ConsoleLogger

use of com.codingchili.core.logging.ConsoleLogger in project chili-core by codingchili.

the class ConfigurationsTest method testLoadDefaultsFromConfigurable.

@Test
public void testLoadDefaultsFromConfigurable(TestContext test) {
    Async async = test.async();
    Configurations.setWarnOnDefaultsLoaded(true);
    Configurations.initialize(new ContextMock(context) {

        @Override
        public Logger logger(Class aClass) {
            return new ConsoleLogger(aClass) {

                @Override
                public void onConfigurationDefaultsLoaded(String path, Class<?> clazz) {
                    if (path.equals(CoreStrings.testFile(CONFIGURATIONS, DEFAULT_JSON))) {
                        Configurations.reset();
                        async.complete();
                    }
                }
            };
        }
    });
    load(CoreStrings.testFile(CONFIGURATIONS, DEFAULT_JSON), ConfigurableTest.class);
}
Also used : Async(io.vertx.ext.unit.Async) ConsoleLogger(com.codingchili.core.logging.ConsoleLogger) ContextMock(com.codingchili.core.testing.ContextMock) Logger(com.codingchili.core.logging.Logger) ConsoleLogger(com.codingchili.core.logging.ConsoleLogger) ConfigurableTest(com.codingchili.core.configuration.ConfigurableTest)

Example 2 with ConsoleLogger

use of com.codingchili.core.logging.ConsoleLogger in project ethereum-ingest by codingchili.

the class VersionCommand method execute.

@Override
public void execute(Future<Boolean> future, CommandExecutor executor) {
    new ConsoleLogger(getClass()).log("Current version is " + launcher().getVersion());
    future.complete(true);
}
Also used : ConsoleLogger(com.codingchili.core.logging.ConsoleLogger)

Aggregations

ConsoleLogger (com.codingchili.core.logging.ConsoleLogger)2 ConfigurableTest (com.codingchili.core.configuration.ConfigurableTest)1 Logger (com.codingchili.core.logging.Logger)1 ContextMock (com.codingchili.core.testing.ContextMock)1 Async (io.vertx.ext.unit.Async)1