January 2018
Intermediate to advanced
434 pages
14h 1m
English
Let's go through the given steps to create an idiomatic logger in Kotlin:
private static final Logger logger = LoggerFactory.getLogger(CurrentClass.class);…logger.info(“Hi, {}”, name);
val logger = LoggerFactory.getLogger(CurrentClass::class)…logger.info(“Hi, {}”, name)
However, apart from this, we can utilize the power of Kotlin using Delegates for the logger. In this case, we will be creating the logger using the lazy keyword. This way, we will create ...
Read now
Unlock full access