Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#280 Use in wxWidgets

future
open
Václav Zeman
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 Zeman
    Václav Zeman
    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 Zeman
    Václav Zeman
    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 Zeman 2013-10-15
    • Václav Zeman
      Václav Zeman
      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 Zeman
    Václav Zeman
    2013-11-29

    • Group: v1.0.5 --> future