Search code examples
c++wxwidgets

wxWidgets 3.0 wxLog:: OnLog and DoLog missing?


From wxWidget 3.0 documentation for wxLog http://docs.wxwidgets.org/3.0/classwx_log.html, it seems that the wxLog class no longer has a OnLog() member, which was in wxWidgets 2.8 (http://docs.wxwidgets.org/2.8/wx_wxlog.html#wxlogonlog). The 3.0 documentation mentions OnLog() once, but there is really no entry for it.

There is a similar issue for wxLog::DoLog()

I was wondering what happened to these functions. I have third party legacy code that still use these two functions. How should I migrate the legacy code with wxLog::OnLog()/DoLog()?

Thanks,


Solution

  • wxLog::OnLog() still exists and probably should be documented, its documentation seems to have been lost during the migration to Doxygen, thanks for noticing this. In any case, you can continue calling it.

    DoLog() also still exists but is deprecated and this is actually documented in the change log:

    • Custom log targets should be updated to override wxLog::DoLogRecord() method  instead of DoLog() or DoLogString() and must be updated if they call the base  class versions of these functions as this won't work any more; please see the  documentation of wxLog for more information.

    So while you can still continue using it as well, it will give deprecation warnings and will stop being supported by default in wxWidgets 3.2 and at all in 3.4.