L1nkZ / rpatchur

A customizable, cross-platform patcher for Ragnarok Online clients.
https://l1nkz.github.io/rpatchur/
Apache License 2.0
50 stars 34 forks source link

how to enable logs ? #15

Closed olsonpm closed 3 years ago

olsonpm commented 3 years ago

I've been having a rough time acclimating to rust since this project is my introduction to it

Anyhoo, I'm trying to view logs to debug an issue with the patches not being read in, but I can't get the logs to show. I can get logs to show in a separate little "hello world"ish rust program but this one the logs don't show up.

I've tried installing the exact same versions of log and simple_logger into your project as well as removing the max level feature declaration in cargo.toml and any level filters in your code. Still, in rpatchur/src/main.rs, when I just do

fn main() {
    SimpleLogger::new().init().unwrap();
    log::warn!("This is an example message.");
    ...

the logs don't show up in the command line

λ cargo build && cargo run -- -w C:\my-programs\buzzy-ro
   Compiling rpatchur v0.2.0 (C:\git-repos\cloned\rpatchur\rpatchur)
    Finished dev [unoptimized + debuginfo] target(s) in 3.00s
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `c:\git-repos\cloned\rpatchur\target\debug\rpatchur.exe -w C:\my-programs\buzzy-ro`

I would appreciate any direction you can give me.

Thanks for the tool

olsonpm commented 3 years ago

wow what a pain. After playing around with it some more it looks like

#![windows_subsystem = "windows"]

disables stdout/err ? So the logs get swallowed.

For debugging I can remove that. Normally I'd try to create a PR with a solution but rust has been too frustrating for me to be motivated enough.

waken22 commented 3 years ago

It happened to me too... I needed to comment that line when i found this : https://sciter.com/forums/topic/how-to-enable-println-to-print-to-console/ I feel you about the motivation and frustation :)