-
Notifications
You must be signed in to change notification settings - Fork 422
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
Weirdly formatted text in log with wasm-init #212
Comments
Thanks for filing! Could you let me know what version of wasm-pack you are using and what command you ran? That will help us track down what the issue is. We are not currently localizing the log so this is almost certainly a bug! |
Sure:
This is the exact sequence as above but with The weird thing is that it works fine if I run |
oh thanks for the details @Mackiovello ! particularly that |
Oh boy character encoding issues! Will try this out soon to see if I can reproduce |
Not an encoding issue; those are ECMA-48 SGR codes. Notice the difference between The fix is making sure that whatever is doing the logging is treating the log file as a file, rather than as a terminal. |
Hi! I've actually been working on this one since last week, after discussing it with Ashley and finding it'd be a good first issue. I meant to write an update post yesterday but it got away from me. In any case, the simplest solution for this seems to be just removing the encoding before throwing the message to the log. The message gets formatted in manifest.rs at the check_wasm_bindgen function, in the line Of course, we could just remove the style formatting all together and it'd solve this, but we probably want to preserve that so the program still looks nice in CLI. :p the same crate that contains Currently, I think the issue has to do with where we can address this in the order of events. The error message is formatted in manifest.rs, then thrown to error.rs to form an Error enum before it's passed back up to command.rs, logged using I have a few solutions in mind currently, but I haven't implemented them yet since this is my first open source project and I'm not sure how much I'm allowed to adjust in the code's structure, in addition to being unsure how to do certain things in Rust just yet. The best solution I can think of currently is to have some sort of function that takes the value rather than the reference to the Error enum, takes the message and runs it through I might be overcomplicating this since it's my first issue, so if anyone knows a simpler method I'm absolutely open to hearing. Otherwise, I am going to continue trying to tackle this with Ashley's help today. :) EDIT: oh, and I'm not totally sure about why we get "ERRO" rather than "ERROR" but I'll continue looking into it. |
Thinking of it we could clone it and strip the ansi codes from the clone only and then pass back the other one like normal. I think that's the easiest solution if it's cloneable (which my guess is that it should be) |
@porylporyl "ERRO" appears to be the correct short-level name used by
|
we are going to be working towards a fix for this as we approach solving #298. i am going to close this specific issue as we will track progress in the mini RFC |
To reproduce:
wasm-pack.log
There are two problems here: "ERRO" should be "ERROR" and there is some encoding issue with what should be
"wasm-bindgen"
.I'm on Ubuntu 16.04
Locale, if that matters:
The text was updated successfully, but these errors were encountered: