-
Notifications
You must be signed in to change notification settings - Fork 257
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
Pretty print error logging #360
Comments
As you mention, I think this is beyond the scope of what we'd want to put in schema.core. But I think there are already other libraries/plugins that do precisely what you want (pretty-print the ex-info) -- In particular, maybe look at io.aviso/pretty ? |
I think you're right, the responsibility probably lies elsewhere. Thanks! |
Although, in saying that, should the message still be pretty printed? There's no easy way for anyone downstream to pretty print that. This is in ClojureScript btw. |
Point taken, thanks. A PR to pretty-print the message body would be welcome. |
It appears that the two patches mentioned in the previous comment add TTY codes to the message output. I suppose the intent here is that in a Clojure environment this would eventually go to a TTY-based repl? My question is: what is the intended use in ClojureScript when the ExceptionInfo typically gets thrown and printed to the console. A typical message will look something like the following, with all of the TTY codes just converted to plaintext: |
I haven't actually used Schema in cljs for some time, but hopefully someone else will have an answer. If not I'd be open to making this configurable, would just need to think about the best way to do so ... |
The error messages printed by schema are sometimes quite tricky to parse, for example:
The schema that generated it was quite simple:
but it is very difficult to understand which part doesn't match the schema, and importantly, what the actual value is if it's not matching the schema.
Pretty printing the message in the ex-info would be quite helpful, however I suspect part of the responsibility for pretty printing this might actually fall to the user (e.g. me) to catch and pretty print the data in the ex-info?
The text was updated successfully, but these errors were encountered: