-
Notifications
You must be signed in to change notification settings - Fork 156
[Enhancement] log! output to respect \n
byte, (and other \ escapes)
#506
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
Comments
I don't know how to replicate your problem, please elaborate a bit. I tried: #[derive(Debug, Default)]
struct Outer(Inner);
#[derive(Debug, Default)]
struct Inner {
field_a: i32,
field_b: i32,
}
fn init(_: Url, _: &mut impl Orders<Msg>) -> Model {
log!(Outer::default());
...
} |
Worked it out. I was using the Learning this, there's three options that come to mind: Leave it as is, change log! so that it removes the format! macro, or make a log_fmt! macro that does that. I'd probably go for the first one, and add to the documentation that log! usage should be with comma separation rather than a format string. If it's possible, maybe post |
I don't want to change/design better API for logging until ideally these two issues are resolved:
Another problem - do we want to use So there are some current Rust limitations and we can easily fall into the rabbit hole of the Until then Lines 483 to 532 in 8d04fcd
|
I'm in agreement. Also, since coming across this, I've seen other little things crop up that makes it look like the specifications of how to display text are at odds between Rust and JS. Your rabbit-hole comment prompts me to think it might be something for a stand-alone project. I'll close this issue, and re-open a new one for documentation, referring back to this. |
When logging a pretty debug, instead of multi-line, you get something more like this:
Ideally, it would be as you'd get from the console:
I'm no good with macros, so I wouldn't know where to start. I would happily work to assist directly, though. It would be nice to learn by working with someone on this.
The text was updated successfully, but these errors were encountered: