New: Squelch a few noisy logs.
This commit is contained in:
parent
ed501304a3
commit
96da0a9bea
|
@ -28,7 +28,7 @@ class SaplingParamTool {
|
||||||
ZcashSdk.OUTPUT_PARAM_FILE_NAME
|
ZcashSdk.OUTPUT_PARAM_FILE_NAME
|
||||||
).forEach { paramFileName ->
|
).forEach { paramFileName ->
|
||||||
if (!File(destinationDir, paramFileName).exists()) {
|
if (!File(destinationDir, paramFileName).exists()) {
|
||||||
twig("ERROR: $paramFileName not found at location: $destinationDir")
|
twig("WARNING: $paramFileName not found at location: $destinationDir")
|
||||||
hadError = true
|
hadError = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,10 +63,10 @@ class SaplingParamTool {
|
||||||
val request = Request.Builder().url(url).build()
|
val request = Request.Builder().url(url).build()
|
||||||
val response = client.newCall(request).execute()
|
val response = client.newCall(request).execute()
|
||||||
if (response.isSuccessful) {
|
if (response.isSuccessful) {
|
||||||
twig("fetch succeeded")
|
twig("fetch succeeded", -1)
|
||||||
val file = File(destinationDir, paramFileName)
|
val file = File(destinationDir, paramFileName)
|
||||||
if (file.parentFile.exists()) {
|
if (file.parentFile.exists()) {
|
||||||
twig("directory exists!")
|
twig("directory exists!", -1)
|
||||||
} else {
|
} else {
|
||||||
twig("directory did not exist attempting to make it")
|
twig("directory did not exist attempting to make it")
|
||||||
file.parentFile.mkdirs()
|
file.parentFile.mkdirs()
|
||||||
|
|
|
@ -120,7 +120,7 @@ class PersistentTransactionManager(
|
||||||
tx.accountIndex
|
tx.accountIndex
|
||||||
)
|
)
|
||||||
twig("successfully encoded transaction!")
|
twig("successfully encoded transaction!")
|
||||||
safeUpdate("updating transaction encoding") {
|
safeUpdate("updating transaction encoding", -1) {
|
||||||
updateEncoding(tx.id, encodedTx.raw, encodedTx.txId, encodedTx.expiryHeight)
|
updateEncoding(tx.id, encodedTx.raw, encodedTx.txId, encodedTx.expiryHeight)
|
||||||
}
|
}
|
||||||
} catch (t: Throwable) {
|
} catch (t: Throwable) {
|
||||||
|
@ -131,7 +131,7 @@ class PersistentTransactionManager(
|
||||||
updateError(tx.id, message, ERROR_ENCODING)
|
updateError(tx.id, message, ERROR_ENCODING)
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
safeUpdate("incrementing transaction encodeAttempts (from: ${tx.encodeAttempts})") {
|
safeUpdate("incrementing transaction encodeAttempts (from: ${tx.encodeAttempts})", -1) {
|
||||||
updateEncodeAttempts(tx.id, max(1, tx.encodeAttempts + 1))
|
updateEncodeAttempts(tx.id, max(1, tx.encodeAttempts + 1))
|
||||||
tx = findById(tx.id)!!
|
tx = findById(tx.id)!!
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ class PersistentTransactionManager(
|
||||||
tx.isFailedEncoding() -> twig("Warning: this transaction will not be submitted because it failed to be encoded.")
|
tx.isFailedEncoding() -> twig("Warning: this transaction will not be submitted because it failed to be encoded.")
|
||||||
tx.isCancelled() -> twig("Warning: ignoring cancelled transaction with id ${tx.id}. We will not submit it to the network because it has been cancelled.")
|
tx.isCancelled() -> twig("Warning: ignoring cancelled transaction with id ${tx.id}. We will not submit it to the network because it has been cancelled.")
|
||||||
else -> {
|
else -> {
|
||||||
twig("submitting transaction with memo: ${tx.memo} amount: ${tx.value}")
|
twig("submitting transaction with memo: ${tx.memo} amount: ${tx.value}", -1)
|
||||||
val response = service.submitTransaction(tx.raw)
|
val response = service.submitTransaction(tx.raw)
|
||||||
val error = response.errorCode < 0
|
val error = response.errorCode < 0
|
||||||
twig(
|
twig(
|
||||||
|
@ -197,7 +197,7 @@ class PersistentTransactionManager(
|
||||||
" response: ${response.errorCode}: ${response.errorMessage}"
|
" response: ${response.errorCode}: ${response.errorMessage}"
|
||||||
)
|
)
|
||||||
|
|
||||||
safeUpdate("updating submitted transaction (hadError: $error)") {
|
safeUpdate("updating submitted transaction (hadError: $error)", -1) {
|
||||||
updateError(tx.id, if (error) response.errorMessage else null, response.errorCode)
|
updateError(tx.id, if (error) response.errorMessage else null, response.errorCode)
|
||||||
updateSubmitAttempts(tx.id, max(1, tx.submitAttempts + 1))
|
updateSubmitAttempts(tx.id, max(1, tx.submitAttempts + 1))
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ class PersistentTransactionManager(
|
||||||
updateSubmitAttempts(tx.id, max(1, tx.submitAttempts + 1))
|
updateSubmitAttempts(tx.id, max(1, tx.submitAttempts + 1))
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
safeUpdate("fetching latest tx info") {
|
safeUpdate("fetching latest tx info", -1) {
|
||||||
tx = findById(tx.id)!!
|
tx = findById(tx.id)!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ class PersistentTransactionManager(
|
||||||
* happen within a try/catch block, surrounded by logging. So this helps with that while also
|
* happen within a try/catch block, surrounded by logging. So this helps with that while also
|
||||||
* ensuring that no other coroutines are concurrently interacting with the DAO.
|
* ensuring that no other coroutines are concurrently interacting with the DAO.
|
||||||
*/
|
*/
|
||||||
private suspend fun <R> safeUpdate(logMessage: String = "", block: suspend PendingTransactionDao.() -> R): R? {
|
private suspend fun <R> safeUpdate(logMessage: String = "", priority: Int = 0, block: suspend PendingTransactionDao.() -> R): R? {
|
||||||
return try {
|
return try {
|
||||||
twig(logMessage)
|
twig(logMessage)
|
||||||
pendingTransactionDao { block() }
|
pendingTransactionDao { block() }
|
||||||
|
|
Loading…
Reference in New Issue