env_logger icon indicating copy to clipboard operation
env_logger copied to clipboard

can't see any logs when using #[windows_subsystem = "windows"]

Open wiiznokes opened this issue 1 year ago • 4 comments

Maybe related: #214.

I don't know if we can do anything about it, but I just wasted 10 minutes understanding why my logs no longer worked under Windows. It might be good to mention it in the docs.

wiiznokes avatar Dec 29 '23 18:12 wiiznokes

work around, while not being perfect (only working on debug target):

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

wiiznokes avatar Dec 29 '23 23:12 wiiznokes

So if I understand correctly, windows_subsystem = "windows" means no stdout / stderr is created.

Maybe I don't do enough Windows programming lately but I would assume that setting this is a fairly advanced use case, meaning

  • It would be uncommon enough that documenting might make things more confusing
  • There is a certain level of base understanding expected when using this
    • Obviously, this fails since you are here but wanting to lay out my assumptions so I can better understand why I'm wrong.

Could you help me in finding where my understanding is wrong?

epage avatar Dec 30 '23 02:12 epage

I only use this so that no console pops when launching my program (i'm doing a graphical interface). AFIK, it's the only ways to have this behavior on Windows, so every graphical program will want to use this i think. For example, i know Tauri use it in it's examples

It would be uncommon enough that documenting might make things more confusing

I understand that, it's as you want, maybe having one issue is enought

wiiznokes avatar Dec 30 '23 02:12 wiiznokes

Ah, guis, so this isn't just an advanced issue.

epage avatar Dec 30 '23 14:12 epage