package com.devsoap.tincheck;

import io.micronaut.runtime.Micronaut;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.bridge.SLF4JBridgeHandler;

import java.time.LocalDateTime;
import java.util.TimeZone;

@Slf4j
class Application {

    static {
        SLF4JBridgeHandler.removeHandlersForRootLogger();
        SLF4JBridgeHandler.install();
        TimeZone.setDefault(TimeZone.getTimeZone("Europe/Madrid"));
    }

    public static void main(String[] args) {
        log.info("Running on {}", Runtime.version());
        log.info("Processors: {}, Memory (free/max/total): {}/{}/{}",
                Runtime.getRuntime().availableProcessors(),
                Runtime.getRuntime().freeMemory(),
                Runtime.getRuntime().maxMemory(),
                Runtime.getRuntime().totalMemory());
        log.info("Server time-zone set to {}, current time is {}",
                TimeZone.getDefault().getDisplayName(),
                LocalDateTime.now());
        Micronaut.build(args)
                .banner(false)
                .eagerInitSingletons(true)
                .mainClass(Application.class)
                .start();
    }
}