moves log scope into proc

This commit is contained in:
Ben 2024-04-26 09:31:20 +02:00
parent 78bf06600f
commit 6ddda0f138
No known key found for this signature in database
GPG Key ID: 541B9D8C9F1426A1
2 changed files with 6 additions and 6 deletions

View File

@ -27,9 +27,6 @@ export types
{.push raises: [].}
logScope:
topics = "json deserialization"
template expectJsonKind(
expectedType: type, expectedKinds: set[JsonNodeKind], json: JsonNode
) =
@ -188,6 +185,9 @@ proc fromJson*[T: ref object or object](_: type T, json: JsonNode): ?!T =
let isOptionalValue = typeof(value) is Option
var skip = false # workaround for 'continue' not supported in a 'fields' loop
logScope:
topics = "serde json deserialization"
case mode
of Strict:
if opts.key notin json:

View File

@ -20,9 +20,6 @@ export types
{.push raises: [].}
logScope:
topics = "json serialization"
proc `%`*(s: string): JsonNode =
newJString(s)
@ -99,6 +96,9 @@ proc `%`*[T: object or ref object](obj: T): JsonNode =
let hasSerialize = value.hasCustomPragma(serialize)
var skip = false # workaround for 'continue' not supported in a 'fields' loop
logScope:
topics = "serde json serialization"
case mode
of OptIn:
if not hasSerialize: