mirror of
https://github.com/logos-storage/nim-serde.git
synced 2026-01-05 15:13:09 +00:00
moves log scope into proc
This commit is contained in:
parent
78bf06600f
commit
6ddda0f138
@ -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:
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user