From 51c6451b36e8f3845ba278d42e7c4a9941556986 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 7 Apr 2019 12:44:08 +0200 Subject: Added better logging --- src/main/kotlin/App.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/App.kt') diff --git a/src/main/kotlin/App.kt b/src/main/kotlin/App.kt index 0c586e0..f080357 100644 --- a/src/main/kotlin/App.kt +++ b/src/main/kotlin/App.kt @@ -3,6 +3,7 @@ package space.anity import com.fizzed.rocker.* import com.fizzed.rocker.runtime.* import io.javalin.* +import io.javalin.Handler import io.javalin.apibuilder.ApiBuilder.* import io.javalin.core.util.* import io.javalin.rendering.* @@ -11,9 +12,11 @@ import io.javalin.security.* import io.javalin.security.SecurityUtil.roles import java.io.* import java.nio.file.* +import java.util.logging.* const val fileHome = "files" val databaseController = DatabaseController() +val LOG = Logger.getLogger("App.kt") fun main() { val app = Javalin.create() @@ -81,7 +84,8 @@ fun crawlFiles(ctx: Context) { "content", Files.readAllLines( Paths.get("$fileHome/${ctx.splats()[0]}"), Charsets.UTF_8 - ).toString() + ).toString(), + "filename", File("$fileHome/${ctx.splats()[0]}").name ) ) } catch (_: java.nio.file.NoSuchFileException) { -- cgit v1.2.3