Ok I think this should work: ``` fun <T> T....
# getting-started
p
Ok I think this should work:
Copy code
fun <T> T.debug(): T {
    println(this)
    return this
}
👍 5
o
poohbar: This can be shortened further:
fun <T> T.debug() = also(::println)
😉
👍 1
p
uuuhhhhh.. fancy!
d
This would not be a good design anyway. Only logger module has the responsibility of printing and managing logs. Now you’re giving every object the responsibility, you’re violating the Single Responsibility Principle.