wxLogXXX targets

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
GlenboLake
Earned a small fee
Earned a small fee
Posts: 10
Joined: Mon Sep 27, 2010 4:39 pm

wxLogXXX targets

Post by GlenboLake »

I have a program where I use a pretty decent mixture of wxLogXXX functions. Mostly wxLogError, wxLogMessage, wxLogVerbose, and occasionally wxLogDebug. With the default wxLogGui target, most of these show up in message boxes. I want to redirect verbose and debug messages to stdout, but I also want some of them -- errors and messages in particular -- still to show up in message boxes. I know I can use wxLog::SetActiveTarget(new wxLogStderr(stdout)) to redirect my logs, but this sends ALL log types to the console. Is there a way to change the log target for some log types but not others?

Side note - I know I could just use wxLogTrace and that would throw everything to the console, but I want to be able to use wxLog::SetLogLevel() to change what shows up.
wxWidgets 2.8.11
64-bit Ubuntu 11.04
Post Reply