// this function is a wrapper around strftime(3)
// allows to exclude the usage of wxDateTime
-static wxString TimeStamp(const wxChar *format, time_t t)
+static wxString TimeStamp(const wxString& format, time_t t)
{
#if wxUSE_DATETIME
wxChar buf[4096];
// do it right now to block any new calls to Flush() while we're here
m_bHasMessages = false;
- unsigned repeatCount = 0;
- if ( wxLog::GetRepetitionCounting() )
- {
- repeatCount = wxLog::DoLogNumberOfRepeats();
- }
+ const unsigned repeatCount = LogLastRepetitionCountIfNeeded();
- wxString appName = wxTheApp->GetAppName();
- if ( !appName.empty() )
- appName[0u] = (wxChar)wxToupper(appName[0u]);
+ wxString appName = wxTheApp->GetAppDisplayName();
long style;
wxString titleFormat;
#if wxUSE_LOG_DIALOG
if ( repeatCount > 0 )
- m_aMessages[nMsgCount-1] += wxString::Format(wxT(" (%s)"), m_aMessages[nMsgCount-2].c_str());
+ {
+ m_aMessages[nMsgCount - 1]
+ << " (" << m_aMessages[nMsgCount - 2] << ")";
+ }
+
wxLogDialog dlg(NULL,
m_aMessages, m_aSeverity, m_aTimes,
title, style);
}
// log all kinds of messages
-void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
+void wxLogGui::DoLog(wxLogLevel level, const wxString& szString, time_t t)
{
switch ( level ) {
case wxLOG_Info:
// don't prepend debug/trace here: it goes to the
// debug window anyhow
str += wxT("\r\n");
- OutputDebugString(str);
+ OutputDebugString(str.wx_str());
#else
// send them to stderr
wxFprintf(stderr, wxT("[%s] %s\n"),
{
public:
// ctor & dtor
- wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle);
+ wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxString& szTitle);
virtual ~wxLogFrame();
// menu callbacks
EVT_CLOSE(wxLogFrame::OnCloseWindow)
END_EVENT_TABLE()
-wxLogFrame::wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle)
+wxLogFrame::wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxString& szTitle)
: wxFrame(pParent, wxID_ANY, szTitle)
{
m_log = log;
// -----------
wxLogWindow::wxLogWindow(wxWindow *pParent,
- const wxChar *szTitle,
+ const wxString& szTitle,
bool bShow,
bool bDoPass)
{
m_pLogFrame->Show(bShow);
}
-void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
+void wxLogWindow::DoLog(wxLogLevel level, const wxString& szString, time_t t)
{
// first let the previous logger show it
wxLogPassThrough::DoLog(level, szString, t);
case wxLOG_Status:
// by default, these messages are ignored by wxLog, so process
// them ourselves
- if ( !wxIsEmpty(szString) )
+ if ( !szString.empty() )
{
wxString str;
str << _("Status: ") << szString;
- DoLogString(str, t);
+ LogString(str, t);
}
break;
}
}
-void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
+void wxLogWindow::DoLogString(const wxString& szString, time_t WXUNUSED(t))
{
// put the text into our window
wxTextCtrl *pText = m_pLogFrame->TextCtrl();
m_pTextCtrl = pTextCtrl;
}
-void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
+void wxLogTextCtrl::DoLogString(const wxString& szString, time_t WXUNUSED(t))
{
wxString msg;
TimeStamp(&msg);