In the rule, is there a way to log some debugging ...
# detekt
a
In the rule, is there a way to log some debugging info? In my project
TooGenericExceptionCaught
is not catching a below code
Copy code
fun test() {
    var body = ""
    var title = ""
    var canShowValidNotification = true

    val json = JSONObject(nestedBody)
    try
    {
        body = json.getString("body")
        title = json.getString("title")
    }
    catch (exception: Exception)
    {
        // malformed do not show notification
        canShowValidNotification = false
        val payload = exception.message ?: "empty or null"
        val errorMessage = "Push notification has Invalid Payload"
    }
}
while when I add this in the
TooGenericExceptionCaughtSpec
as test it is successfully passing. I want to publish the
detekt
in my local maven with logs and then analyse the issue
b
You can use println directly.
We have some log methods but I'm not sure if you can access them on the rule.