Commit 409cdf6d authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Add additional logging!

parent 4a5e73b4
Pipeline #27692 passed with stages
in 3 minutes and 28 seconds
......@@ -47,6 +47,9 @@ class Service(file: String = "app.yml") {
val collector = ReportCollector(importApiUrl)
fun run() {"Begin reading from topic ${settings.inputTopic} on kafka cluster.")"Sending aggregated reports to ${importApiUrl}.")"Reading the following steps: ${stepWhitelist.str()}")
while (true) {
.mapNotNull { klaxon.parse<IndexReport>(it.value()) }
package org.memobase
import org.apache.logging.log4j.LogManager
import java.nio.charset.Charset
class StepWhitelist(path: String) {
private val log = LogManager.getLogger(
private val whitelist = File(path).readLines(Charset.defaultCharset())
fun check(step: String): Boolean {
return whitelist.contains(step)
return if (whitelist.contains(step)) {"Step $step is present in whitelist. Processing report.")
} else {"Step $step is not present in whitelist. Not processing.")
fun str(): String {
return whitelist.joinToString(", ")
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment