Skip to content

chore: remove logs #35

Merged
2-towns merged 6 commits into
masterfrom
chore/remove-log-scope-with-generics
Apr 20, 2026
Merged

chore: remove logs #35
2-towns merged 6 commits into
masterfrom
chore/remove-log-scope-with-generics

Conversation

@2-towns
Copy link
Copy Markdown
Contributor

@2-towns 2-towns commented Apr 16, 2026

The logs included in the serializer and deserializer were not working with the file-level logScope due to this bug.

As a workaround, the logScope was moved inside the proc.

However, this introduces gcsafe errors with the latest version of Chronicles.

The bug has existed for years (since 2022) and appears to be somewhat complex to fix. For this reason, the simplest way to resolve the issue is to remove the logs from the affected procs.

By removing these logs, we also eliminate the only usage of Chronicles in nim-serde, allowing the dependency to be removed as well.

@2-towns 2-towns marked this pull request as ready for review April 16, 2026 06:13
@2-towns 2-towns requested a review from emizzle April 16, 2026 06:13
@2-towns 2-towns changed the title chore: remove logs with generics chore: remove logs Apr 16, 2026
Copy link
Copy Markdown
Collaborator

@emizzle emizzle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Small suggestions to remove some more dead code, but nothing blocking.

Comment thread serde/json/deserializer.nim Outdated
Comment on lines +205 to +207
elif opts.ignore:
# unable to figure out a way to make this a compile time check
warn "object field marked as 'ignore' while in Strict mode, field will be deserialized anyway"
discard
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should just remove this block.

Comment thread serde/json/deserializer.nim Outdated
Comment on lines +218 to +219
elif hasDeserializePragma and opts.key == name:
warn "object field marked as deserialize in OptOut mode, but 'ignore' not set, field will be deserialized"
discard
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Comment thread serde/json/serializer.nim Outdated
Comment on lines +102 to +103
elif hasSerialize and opts.key == name: # all serialize params are default
warn "object field marked as serialize in OptOut mode, but 'ignore' not set, field will be serialized"
discard
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Comment thread serde/json/serializer.nim Outdated
Comment on lines +104 to +107
of Strict:
if opts.ignore:
# unable to figure out a way to make this a compile time check
warn "object field marked as 'ignore' while in Strict mode, field will be serialized anyway"
discard
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably remove this entire branch (starting with of Strict)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Strict case is needed for Nim, in order to cover all the enum cases

@2-towns
Copy link
Copy Markdown
Contributor Author

2-towns commented Apr 20, 2026

Nice! Small suggestions to remove some more dead code, but nothing blocking.

Yeah thanks for the suggestions ! I applied them.

@2-towns 2-towns merged commit 5b4065d into master Apr 20, 2026
3 checks passed
@2-towns 2-towns deleted the chore/remove-log-scope-with-generics branch April 20, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants