Fixed the logger properly

This commit is contained in:
Mark Watkins 2011-06-06 14:48:02 +10:00
parent 336ac05302
commit 8aef7f710d
2 changed files with 6 additions and 10 deletions

View File

@ -8231,7 +8231,7 @@
<wx/datectrl.h>
<wx/dateevt.h>
1307275348 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp
1307335612 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp
"wx_pch.h"
<iostream>
<wx/log.h>

View File

@ -37,16 +37,12 @@ IMPLEMENT_APP(SleepyHeadApp);
bool SleepyHeadApp::OnInit()
{
// Initialize the logger
#if defined(wxUSE_STD_IOSTREAM)
// Standard bottled linux build, plus my WXMSW build needs it
wxLog *logger=new wxLogStream(&std::cout);
// It helps to allocate the logger on the heap.. This show work for all platforms now :)
wxLog *logger=new wxLogStderr(NULL); //LogWindow(NULL,wxT("Debug"),true,true);
wxLog::SetActiveTarget(logger);
#else
// wxLogStream requires wxWidgets to be built with wxUSE_STD_IOSTREAM which is not default
// use STDERR for wxLogging for better portability for now
wxLogStderr(NULL);
#endif
wxLogDebug( wxVERSION_STRING );
wxLogDebug( wxT("Application Initialze...") );