OSVR / SteamVR-OSVR

An OSVR plugin for SteamVR, providing SteamVR support for OSVR HMDs.
Apache License 2.0
138 stars 57 forks source link

Add compile-time option for properties debugging #42

Closed d235j closed 8 years ago

d235j commented 8 years ago

This allows for debugging which properties a client program requests.

It would be nice to have "release" and "debug" builds from the CI server, with things like this enabled for "debug" builds.

godbyk commented 8 years ago

Do you know how we can read configuration information from, say, the drivers.cfg file (where we had to add the [OSVR] heading)? If so, we could add a flag there to enable/disable the debug logging without having to recompile. (I'm assuming SteamVR doesn't request property values as such a rate to case too much lag if we were to branch at runtime.)

rpavlik commented 8 years ago

Yes, we can read stuff from there. We're not guaranteed to get a non-nullptr (though I think in reality you probably always do unless you're running under the OSVR-Vive plugin :-P - the drivers just handle it fine), but both IClientDriverHost and IServerDriverHost have a GetSettings method that takes the IVRSettings_Version constant and returns an IVRSettings pointer.

I don't know if that handles the drivers.cfg file, or the steamvr.vrsettings file, or the steamvr.cfg file, but it's a settings interface of some sort - presumably you could test it out and see what the stock implementation provides access to these days.

I think this would be the preferable way to do it, vs. a compile time definition. If we do need compile time switches, it would be preferred to "namespace" the macros with at least OSVR_ to avoid colliding.

godbyk commented 8 years ago

I merged in a variant of this. Also, in the config branch, there's a version that reads a verbose setting and uses that for logging. (It's currently untested, however.)