02/02/2018, 12:17 AM
they discuss creating a static field which is only available within the file, but I can't tell if they're saying sharing an instance is a bad idea


02/02/2018, 7:15 PM
It is bad only in the sense that the name of that logger will be the same in all classes it is used, not because it is some performance/thread safety issue. This is just a small, kotlin idiomatic facade over sl4j, and you can use one static slf4j Logger instance in all classes if that is your preference. I usually do the first suggestion, if there is more then one class in the file logger is created, they all have the same logger name, but that is usually fine, since you are probably grouping them in one file with good reason. If you need to have different names of logger for different classes, method 2 will work fine