Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional information when decoding the models #3

Merged
merged 1 commit into from
May 24, 2023

Conversation

mdb1
Copy link
Owner

@mdb1 mdb1 commented May 24, 2023

Closes #2

The idea behind this PR is to add the option to log additional information to the console when decoding models.

Examples:

Success Decoding Example:

 ===> JSON Decoding start:
Model:
 CoreNetworkingTests.CatFact
  - fact: "The biggest wildcat today is the Siberian Tiger. It can be more than 12 feet (3.6 m) long (about the size of a small car) and weigh up to 700 pounds (317 kg)."
  - length: 158
Additional Info:
 1 key/value pair
   (2 elements)
    - key: "UTF8 - String"
    - value: "{\"fact\":\"The biggest wildcat today is the Siberian Tiger. It can be more than 12 feet (3.6 m) long (about the size of a small car) and weigh up to 700 pounds (317 kg).\",\"length\":158}"
 <=== JSON Decoding end.

Decoding Issue Example:

 ===> JSON Decoding issue start:
Error description: Key 'CodingKeys(stringValue: "fact", intValue: nil)' not found
Additional Info:
 2 key/value pairs
   (2 elements)
    - key: "Model"
    - value: "CatFact"
   (2 elements)
    - key: "Context"
    - value: "No value associated with key CodingKeys(stringValue: \"fact\", intValue: nil) (\"fact\")."
 <=== JSON Decoding issue end.

@mdb1 mdb1 added the enhancement New feature or request label May 24, 2023
@mdb1 mdb1 self-assigned this May 24, 2023
@mdb1
Copy link
Owner Author

mdb1 commented May 24, 2023

@gentilijuanmanuel let me know if this would be useful for you 😄

@gentilijuanmanuel
Copy link
Contributor

@mdb1 Man thank you so much for doing this!

I'll review it this afternoon and provide feedback 😄

Thank you again, really appreciate it!

Copy link
Contributor

@gentilijuanmanuel gentilijuanmanuel left a comment

Choose a reason for hiding this comment

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

🚀 ☘️

@mdb1 mdb1 merged commit 164b45d into main May 24, 2023
@mdb1 mdb1 deleted the additional-logging branch May 24, 2023 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more information about the decoding errors
2 participants