All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vinaygaba.codegen.logging.Logger.kt Maven / Gradle / Ivy

There is a newer version: 0.0.6
Show newest version
package com.vinaygaba.codegen.logging

import javax.annotation.processing.Messager
import javax.tools.Diagnostic

class Logger {
    private val loggedExceptions: MutableList = mutableListOf()
    
    
    fun logMessage(message: String) {
        logError(Exception(message))
    }
    
    fun logError(e: Exception) {
        loggedExceptions += e
    }
    
    fun publishMessages(messager: Messager?) {
        loggedExceptions.forEach { messager?.printMessage(Diagnostic.Kind.ERROR, "${it.message}") }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy