jp7677 / dxvk-nvapi

Alternative NVAPI implementation on top of DXVK.
MIT License
373 stars 32 forks source link

Improve logging #180

Closed jp7677 closed 3 months ago

jp7677 commented 4 months ago

Some ideas for a free afternoon.

Based on recent reports and observations, some ideas

SveSop commented 4 months ago

It looks good... Only thing i could "wish for", although it would probably mean a lot of work is for a "debug" override, where all these "alreadyLoggedXX" gets discarded and you get ALL output. Its not a huge issue for me to change and recompile in those instances i am looking at a particular function tho, so it is not something i feel is overly "missing", but sometimes if you get 10 calls in a row for a certain function you would know something could be up 😄 Eg: DXVK_NVAPI_LOG_LEVEL=debug would print all subsequent calls.

As i said.. not horribly needed, and would probably mean more work than useful, but if you are feeling bored some day....

Saancreed commented 4 months ago

That actually doesn't sound too hard to implement, considering that everything already goes through util_statuscode.h we would just need functions from that file check some flag set via environment variable before checking/setting the "already logged" variable.

jp7677 commented 4 months ago

Yeah, certainly doable to omit alreadyLoggedSomething, that said, I guess in that case we would also need a DXVK_NVAPI_LOG_FILTER like thing to, well, filter logs. May be just a comma separated list of (case insensitive) strings where the actual log message has to start with?

Saancreed commented 4 months ago

I think that would be an overkill for now. Let's just have a flag that changes log statements to print always and everything, this stuff can be slow, sure, but any filtering can be done using external tools on the final log file.

jp7677 commented 4 months ago

Reopen because no full tracing yet.