Add a temp stub to dialog_log.cpp to get it building on windows. This still has memory issues which I'll fix along with a new util function to get localtime_r() data on windows+unix.
Originally committed to SVN as r4412.
This commit is contained in:
parent
86a3d0792a
commit
2e156b8c4f
1 changed files with 12 additions and 0 deletions
|
@ -46,6 +46,7 @@
|
||||||
#include <wx/statline.h>
|
#include <wx/statline.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "dialog_log.h"
|
#include "dialog_log.h"
|
||||||
|
@ -97,6 +98,7 @@ LogWindow::EmitLog::EmitLog(wxTextCtrl *t): text_ctrl(t) {
|
||||||
|
|
||||||
|
|
||||||
void LogWindow::EmitLog::Write(agi::log::SinkMessage *sm) {
|
void LogWindow::EmitLog::Write(agi::log::SinkMessage *sm) {
|
||||||
|
#ifndef _WIN32
|
||||||
tm tmtime;
|
tm tmtime;
|
||||||
localtime_r(&sm->tv.tv_sec, &tmtime);
|
localtime_r(&sm->tv.tv_sec, &tmtime);
|
||||||
wxString log = wxString::Format("%c %02d:%02d:%02d %ld <%-25s> [%s:%s:%d] %s\n",
|
wxString log = wxString::Format("%c %02d:%02d:%02d %ld <%-25s> [%s:%s:%d] %s\n",
|
||||||
|
@ -110,9 +112,19 @@ void LogWindow::EmitLog::Write(agi::log::SinkMessage *sm) {
|
||||||
sm->func,
|
sm->func,
|
||||||
sm->line,
|
sm->line,
|
||||||
strndup(sm->message, sm->len));
|
strndup(sm->message, sm->len));
|
||||||
|
#else
|
||||||
|
wxString log = wxString::Format("%c %ld <%-25s> [%s:%s:%d] %s\n",
|
||||||
|
agi::log::Severity_ID[sm->severity],
|
||||||
|
sm->tv.tv_usec,
|
||||||
|
sm->section,
|
||||||
|
sm->file,
|
||||||
|
sm->func,
|
||||||
|
sm->line,
|
||||||
|
sm->message);
|
||||||
|
|
||||||
text_ctrl->AppendText(log);
|
text_ctrl->AppendText(log);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void LogWindow::EmitLog::log(agi::log::SinkMessage *sm) {
|
void LogWindow::EmitLog::log(agi::log::SinkMessage *sm) {
|
||||||
Write(sm);
|
Write(sm);
|
||||||
|
|
Loading…
Reference in a new issue