I'd like to be able to print info from inside a rust win32 app. But because I use #![windows_subsystem = "windows"]
, there is no stdout or stderr to print to.
So, I tried logging:
#![windows_subsystem = "windows"]
#[macro_use] extern crate log;
extern crate simplelog;
extern crate winapi;
use simplelog::*;
use std::fs::File;
// Lots elided
quick_main!(run);
fn run() -> Result<()> {
WriteLogger::new(LevelFilter::Info, Config::default(), File::create("debug.log").unwrap());
info!("starting up");
// Lots elided including more info!() calls
}
This creates an empty debug.log
file, but never writes to it.
I don't need (or want) to use a debugger & was hoping to be able to print to a file.