diff options
author | Marvin Borner | 2019-04-07 12:44:08 +0200 |
---|---|---|
committer | Marvin Borner | 2019-04-07 12:44:08 +0200 |
commit | 51c6451b36e8f3845ba278d42e7c4a9941556986 (patch) | |
tree | 04322889be28112838decb6030f0b16504fa86a0 /src/main/kotlin/App.kt | |
parent | b46ac266bb8625c09c07f7df43cb3da9a0bfe1ac (diff) |
Added better logging
Diffstat (limited to 'src/main/kotlin/App.kt')
-rw-r--r-- | src/main/kotlin/App.kt | 6 |
1 files changed, 5 insertions, 1 deletions
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) { |