warn -> debug log levels in errors.nim

This commit is contained in:
Giovanni Petrantoni 2020-08-20 16:53:28 +09:00
parent eb13845f65
commit 840a76915e
1 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ macro checkFutures*[T](futs: seq[Future[T]], exclude: untyped = []): untyped =
if res.failed: if res.failed:
let exc = res.readError() let exc = res.readError()
# We still don't abort but warn # We still don't abort but warn
warn "A future has failed, enable trace logging for details", error = exc.name debug "A future has failed, enable trace logging for details", error = exc.name
trace "Exception message", msg= exc.msg, stack = getStackTrace() trace "Exception message", msg= exc.msg, stack = getStackTrace()
else: else:
quote do: quote do:
@ -32,7 +32,7 @@ macro checkFutures*[T](futs: seq[Future[T]], exclude: untyped = []): untyped =
trace "A future has failed", error=exc.name, msg=exc.msg trace "A future has failed", error=exc.name, msg=exc.msg
break check break check
# We still don't abort but warn # We still don't abort but warn
warn "A future has failed, enable trace logging for details", error=exc.name debug "A future has failed, enable trace logging for details", error=exc.name
trace "Exception details", msg=exc.msg trace "Exception details", msg=exc.msg
proc allFuturesThrowing*[T](args: varargs[Future[T]]): Future[void] = proc allFuturesThrowing*[T](args: varargs[Future[T]]): Future[void] =
@ -63,5 +63,5 @@ template tryAndWarn*(message: static[string]; body: untyped): untyped =
except CancelledError as exc: except CancelledError as exc:
raise exc raise exc
except CatchableError as exc: except CatchableError as exc:
warn "An exception has ocurred, enable trace logging for details", name = exc.name, msg = message debug "An exception has ocurred, enable trace logging for details", name = exc.name, msg = message
trace "Exception details", exc = exc.msg trace "Exception details", exc = exc.msg