Open shopglobal opened 6 years ago
I think $ export RUST_BACKTRACE=trace
might help.
The executable currently doesn't display anything interesting (yet) however I think it should output info!
and warn!
log messages, anyway using trace!
-level log can be used to develop and debug the program.
Thanks for pointing this out, possibly a custom log
could be made to show the log on stdout
. If I get something working within the following minutes I'm going to open a PR so you can see if it fits your needs (or you can try to do it too).
https://stackoverflow.com/questions/49062707/capture-both-stdout-stderr-via-pipe Does this method look like it can help?
use std::io::{BufRead, BufReader};
use std::process::{Command, Stdio};
fn main() {
let child = Command::new("./dxrm")
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.unwrap();
let output = child.wait_with_output().unwrap();
let out = BufReader::new(&*output.stdout);
let err = BufReader::new(&*output.stderr);
out.lines().for_each(|line|
println!("out: {}", line.unwrap());
);
err.lines().for_each(|line|
println!("err: {}", line.unwrap());
);
println!("{}", output.status);
}
@shopglobal It won't work the way you think, to show log on stdout you need to create a logger interface inside the dxmr
code, the interface needs to implement Log
. Currently dxmr
uses env_logger
(implements Log
) that needs the RUST_LOG
environment variable to be set (to a valid log level) and then prints the log to stdout
.
So I tested the
cargo run
for this crate, and am presented with a blank output. Is this the intended function? Or should we be booting up the daemon with./dxmr
? Is it headless? Api? Do we just need to add logging? Could you catch me up to speed? Looking forward to collaborating.