LibDebugLog-1.0 aims at providing a simple debug API.
By default, all messages are printed to the default chat frame. But as soon as one MessageLogged callback is registered, the library becomes quiet and sends all messages through this way.
DebugLogBackend is an example of backend.
Note: the standalone version ships with a little code stub that makes the debugging setting persistent through sessions.