aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/DatabaseController.kt
diff options
context:
space:
mode:
authorMarvin Borner2019-05-17 19:58:35 +0200
committerMarvin Borner2019-05-17 19:58:35 +0200
commit270f58144eac1797ef55567d644d6213f315bb15 (patch)
tree97db8e8fee59aa7bf85647337571ef4bad0056c7 /src/main/kotlin/DatabaseController.kt
parent95a30ce9efc15ca61a3afab6117e2bdbbf54166e (diff)
Improved logging functionality
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main/kotlin/DatabaseController.kt')
-rw-r--r--src/main/kotlin/DatabaseController.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/kotlin/DatabaseController.kt b/src/main/kotlin/DatabaseController.kt
index 481d23b..c6803a5 100644
--- a/src/main/kotlin/DatabaseController.kt
+++ b/src/main/kotlin/DatabaseController.kt
@@ -6,14 +6,14 @@ import io.javalin.rendering.template.TemplateUtil.model
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.*
import org.joda.time.*
+import org.slf4j.*
import java.sql.*
-import java.util.logging.*
class DatabaseController {
private val dbFileLocation =
if (System.getProperty("os.name") != "Linux" || debug) "main.db" else "/usr/share/kloud/main.db"
val db: Database = Database.connect("jdbc:sqlite:$dbFileLocation", "org.sqlite.JDBC")
- private val log = Logger.getLogger(this.javaClass.name)
+ private val log = LoggerFactory.getLogger(this.javaClass.name)
/**
* Database table indexing the file locations
@@ -118,7 +118,7 @@ class DatabaseController {
}
true
} catch (_: Exception) {
- log.warning("User already exists!")
+ log.warn("User already exists!")
false
}
}
@@ -322,7 +322,7 @@ class DatabaseController {
}
true
} else {
- if (!isDirectoryBool && debug) log.warning("File already exists!")
+ if (!isDirectoryBool && debug) log.warn("File already exists!")
false
}
} catch (err: Exception) {
@@ -340,7 +340,7 @@ class DatabaseController {
// TODO: Think of new solution for directory deleting (instead of wildcards)
FileLocation.deleteWhere { (FileLocation.path like "$fileLocation%") and (FileLocation.userId eq userId) }
} catch (_: Exception) {
- log.warning("File does not exist!")
+ log.warn("File does not exist!")
}
}
}
@@ -399,7 +399,7 @@ class DatabaseController {
} else
ReturnFileData(-1, "", false)
} catch (_: Exception) {
- log.warning("File does not exist!")
+ log.warn("File does not exist!")
ReturnFileData(-1, "", false)
}
}