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

println! with iex -S mix produces poorly formatted output #335

Open
vans163 opened this issue Nov 3, 2020 · 5 comments
Open

println! with iex -S mix produces poorly formatted output #335

vans163 opened this issue Nov 3, 2020 · 5 comments

Comments

@vans163
Copy link

vans163 commented Nov 3, 2020

image

It looks like this basically.

@hansihe
Copy link
Member

hansihe commented Nov 3, 2020

Not much we can do about this I believe.

An alternative would be to introduce a new printing function in rustler that uses the BEAM provided printing functions.

Relevant: #72

@hansihe
Copy link
Member

hansihe commented Nov 3, 2020

There is this, which could enable us to change where the default rust print functions send their outputs. This seems to be what the rust test framework uses.

The issue is I don't think there is any way for us to statically execute code on every scheduler thread, so I don't think we can actually use this.

https://github.com/rust-lang/rust/blob/db15596c5747eed0344f2622a9d85ad9534b23f9/library/std/src/io/stdio.rs#L934-L963

@scrogson
Copy link
Member

scrogson commented Nov 4, 2020

FWIW, I've had pretty good luck using env_logger: https://github.com/scrogson/franz/blob/master/native/franz/src/lib.rs#L12

@filmor
Copy link
Member

filmor commented Nov 4, 2020

The set_print is also unstable. Maybe we should just document that using print! etc. is a bad idea and people should use the log crate instead.

@cannadayr
Copy link

cannadayr commented Sep 1, 2021

I am using the env_logger crate and am still having this behavior. Is this expected? (ie does this issue go deeper into the rust/erlang logging interaction). If its not expected, is there a code example that might be able to get logging output without the extra spaces? Are there any known workarounds? (for example syslog)

cannadayr added a commit to cannadayr/rsbqn that referenced this issue Sep 24, 2021
this is due to output as documented in following github issue:
rusterlium/rustler#335

currently uses USER syslog facility
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

No branches or pull requests

5 participants