rust-cli / env_logger

A logging implementation for `log` which is configured via an environment variable.
https://docs.rs/env_logger
Apache License 2.0
813 stars 126 forks source link

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

Open wiiznokes opened 9 months ago

wiiznokes commented 9 months ago

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 commented 9 months ago

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

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
epage commented 9 months ago

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

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

wiiznokes commented 9 months ago

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

epage commented 9 months ago

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