gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: debug


From: gnunet
Subject: [libeufin] branch master updated: debug
Date: Sat, 11 Jan 2020 09:28:58 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 2ac98c6  debug
2ac98c6 is described below

commit 2ac98c6d8c712e5de360d1dc64da4f4ecd93c0d1
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Jan 11 09:28:50 2020 +0100

    debug
---
 nexus/src/main/kotlin/DB.kt                           | 3 +--
 sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt   | 8 +++-----
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 8 +++++---
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/nexus/src/main/kotlin/DB.kt b/nexus/src/main/kotlin/DB.kt
index 953bfff..aba2e5c 100644
--- a/nexus/src/main/kotlin/DB.kt
+++ b/nexus/src/main/kotlin/DB.kt
@@ -38,8 +38,7 @@ fun dbCreateTables() {
     Database.connect("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", driver = 
"org.h2.Driver")
 
     transaction {
-        // addLogger(StdOutSqlLogger)
-
+        addLogger(StdOutSqlLogger)
         SchemaUtils.create(
             EbicsSubscribersTable
         )
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
index 4500a2f..79a6aca 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -345,7 +345,6 @@ class EbicsOrderSignatureEntity(id: EntityID<Int>) : 
IntEntity(id) {
     var signatureValue by EbicsOrderSignaturesTable.signatureValue
 }
 
-
 object EbicsUploadTransactionChunksTable : IdTable<String>() {
     override val id =
         text("transactionID").entityId()
@@ -353,7 +352,6 @@ object EbicsUploadTransactionChunksTable : 
IdTable<String>() {
     val chunkContent = blob("chunkContent")
 }
 
-
 class EbicsUploadTransactionChunkEntity(id : EntityID<String>): 
Entity<String>(id) {
     companion object : EntityClass<String, 
EbicsUploadTransactionChunkEntity>(EbicsUploadTransactionChunksTable)
 
@@ -363,12 +361,12 @@ class EbicsUploadTransactionChunkEntity(id : 
EntityID<String>): Entity<String>(i
 
 
 fun dbCreateTables() {
-    Database.connect("jdbc:sqlite:libeufin-sandbox.sqlite3", "org.sqlite.JDBC")
-    // Database.connect("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", driver = 
"org.h2.Driver")
+    // Database.connect("jdbc:sqlite:libeufin-sandbox.sqlite3", 
"org.sqlite.JDBC")
+    Database.connect("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", driver = 
"org.h2.Driver")
     TransactionManager.manager.defaultIsolationLevel = 
Connection.TRANSACTION_SERIALIZABLE
 
     transaction {
-
+        addLogger(StdOutSqlLogger)
         SchemaUtils.create(
             BankTransactionsTable,
             BankCustomersTable,
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index ce436c1..f983f31 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -38,6 +38,8 @@ import io.ktor.routing.post
 import io.ktor.routing.routing
 import io.ktor.server.engine.embeddedServer
 import io.ktor.server.netty.Netty
+import org.jetbrains.exposed.sql.StdOutSqlLogger
+import org.jetbrains.exposed.sql.addLogger
 import org.jetbrains.exposed.sql.and
 import org.jetbrains.exposed.sql.transactions.transaction
 import org.joda.time.DateTime
@@ -53,7 +55,6 @@ import java.text.DateFormat
 import javax.sql.rowset.serial.SerialBlob
 import javax.xml.bind.JAXBContext
 
-
 class CustomerNotFound(id: String?) : Exception("Customer ${id} not found")
 class BadInputData(inputData: String?) : Exception("Customer provided invalid 
input data: ${inputData}")
 class BadAmount(badValue: Any?) : Exception("Value '${badValue}' is not a 
valid amount")
@@ -61,6 +62,7 @@ class UnacceptableFractional(statusCode: HttpStatusCode, 
badNumber: BigDecimal)
     "Unacceptable fractional part ${badNumber}"
 )
 
+val LOGGER: Logger = LoggerFactory.getLogger("tech.libeufin.sandbox")
 
 fun findCustomer(id: String?): BankCustomerEntity {
 
@@ -72,6 +74,7 @@ fun findCustomer(id: String?): BankCustomerEntity {
     }
 
     return transaction {
+        addLogger(StdOutSqlLogger)
         BankCustomerEntity.findById(idN) ?: throw CustomerNotFound(id)
     }
 }
@@ -139,6 +142,7 @@ fun sampleData() {
         }
 
         val customerEntity = BankCustomerEntity.new {
+            addLogger(StdOutSqlLogger)
             name = "Mina"
         }
 
@@ -200,8 +204,6 @@ fun calculateBalance(id: Int, start: String?, end: 
String?): BigDecimal {
     return ret
 }
 
-val LOGGER: Logger = LoggerFactory.getLogger("tech.libeufin.sandbox")
-
 fun main() {
 
     dbCreateTables()

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]