From 6ddda0f13878a34734f22a4b25e8e133b25c4937 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 26 Apr 2024 09:31:20 +0200 Subject: [PATCH] moves log scope into proc --- serde/json/deserializer.nim | 6 +++--- serde/json/serializer.nim | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/serde/json/deserializer.nim b/serde/json/deserializer.nim index de7b620..be2961b 100644 --- a/serde/json/deserializer.nim +++ b/serde/json/deserializer.nim @@ -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: diff --git a/serde/json/serializer.nim b/serde/json/serializer.nim index db9d2e6..fe6deb5 100644 --- a/serde/json/serializer.nim +++ b/serde/json/serializer.nim @@ -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: