mirror of
https://github.com/codex-storage/nim-codex-dht.git
synced 2025-02-13 12:26:34 +00:00
Fix logging format (#87)
* add shortLog for Address * compile with trace logging to catch errors
This commit is contained in:
parent
dd4985435a
commit
a7f14bc9b7
@ -2,15 +2,22 @@ import std / [os, strutils, sequtils]
|
||||
|
||||
task testAll, "Run DHT tests":
|
||||
exec "nim c -r tests/testAll.nim"
|
||||
rmFile "./tests/testAll"
|
||||
|
||||
task test, "Run DHT tests":
|
||||
# compile with trace logging to make sure it doesn't crash
|
||||
exec "nim c -d:testsAll -d:chronicles_enabled=on -d:chronicles_log_level=TRACE tests/testAll.nim"
|
||||
rmFile "./tests/testAll"
|
||||
exec "nim c -r -d:testsAll --verbosity:0 tests/testAllParallel.nim"
|
||||
rmFile "./tests/testAllParallel"
|
||||
|
||||
task testPart1, "Run DHT tests A":
|
||||
exec "nim c -r -d:testsPart1 tests/testAllParallel.nim"
|
||||
rmFile "./tests/testAllParallel"
|
||||
|
||||
task testPart2, "Run DHT tests B":
|
||||
exec "nim c -r -d:testsPart2 tests/testAllParallel.nim"
|
||||
rmFile "./tests/testAllParallel"
|
||||
|
||||
task coverage, "generates code coverage report":
|
||||
var (output, exitCode) = gorgeEx("which lcov")
|
||||
|
@ -441,7 +441,7 @@ proc decodeMessagePacket(c: var Codec, fromAddr: Address, nonce: AESGCMNonce,
|
||||
if pt.isNone():
|
||||
# Don't consider this an error, the session got probably removed at the
|
||||
# peer's side and a random message is send.
|
||||
# This might also be a cross-connect. Not deleteing key, as it might be
|
||||
# This might also be a cross-connect. Not deleting key, as it might be
|
||||
# needed later, depending on message order.
|
||||
trace "Decrypting failed (invalid keys)", address = fromAddr
|
||||
#c.sessions.del(srcId, fromAddr)
|
||||
|
@ -177,3 +177,8 @@ func shortLog*(nodes: seq[Node]): string =
|
||||
|
||||
result.add("]")
|
||||
chronicles.formatIt(seq[Node]): shortLog(it)
|
||||
|
||||
func shortLog*(address: Address): string =
|
||||
$address
|
||||
|
||||
chronicles.formatIt(Address): shortLog(it)
|
||||
|
Loading…
x
Reference in New Issue
Block a user