Menu

#280 Use in wxWidgets

future
open
wxWidgets (1)
5
2013-11-29
2013-10-14
gmas
No

In the package, I have found references to Qt, but nothing to wxWidgets.
What is the best way to integrate log4cplus in a wxWidgets GUI program? Do you have references to projects that successfully use both libraries at the same time?

Discussion

  • Václav Haisman

    Václav Haisman - 2013-10-14

    In the package, I have found references to Qt, but nothing to wxWidgets.

    Log4cplus references Qt because it has Qt appenders that forward the logging to Qt debugging facilities. There is no more integration of Qt to log4cplus than that.

    What is the best way to integrate log4cplus in a wxWidgets GUI program? Do you have references to projects that successfully use both libraries at the same time?

    I do not have any such examples. I do not see any problem with this combination of libraries.

     
  • Václav Haisman

    Václav Haisman - 2013-10-14
    • assigned_to: Václav Zeman
     
  • gmas

    gmas - 2013-10-15

    Many thanks for the quick answer! Since you are so kind, could you please suggest how can I redirect the output of a log4cplus to a wxTxtCtrl in a flavor similar to this code snippets?

    #include <iostream>
    wxTextCtrl *control = new wxTextCtrl(...);
    std::streambuf *sbOld = std::cout.rdbuf();
    std::cout.rdbuf(control);
    ...
    std::cout.rdbuf(sbOld);
    
     

    Last edit: Václav Haisman 2013-10-15
    • Václav Haisman

      Václav Haisman - 2013-10-15

      On your first post I took a look at wxWidgets documentation and I thought I could add an appender, similar to the exiting Qt appenders, that would be using functions like wxLogError(), wxLogMessage(), wxLogWarning(), etc.

      What you are describing above is slightly different. I suggest that you take a look at, say, consoleappender.cxx or nullappender.cxx to see how to implement a simple appender that wraps the wxTextCtrl yourself.

       
  • Václav Haisman

    Václav Haisman - 2013-11-29
    • Group: v1.0.5 --> future
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.