
上QQ阅读APP看书,第一时间看更新
How it works...
Here, one thing to note is that we have put our logger inside a companion object. The reason for this is quite straightforward because we want to have only one instance of logger per class.
Also, logger() returns a delegate object, which means that the object will be created on its first access and will return the same value (object) on subsequent accesses.