The Win32 EDIT control caps text at ~32K/64K chars by default, so the client log dialog silently stopped accepting appends long before the 512KB truncation logic could run. Call SetLimitText(0) in both CClientLog and CActivityDialog to lift the cap. Also unify newline handling in Logger: each entry now ends with exactly one '\n' at the source, so the in-memory ring-buffer dump (used by the TCP log query) splits into lines correctly instead of relying on every Mprintf caller ending its format with '\n'. writeToFile drops the extra std::endl accordingly. Additionally fix a CFont leak in CClientLog::OnInitDialog by moving the font to a member. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
723 B
C++
33 lines
723 B
C++
#pragma once
|
|
#include "afxcmn.h"
|
|
#include "IOCPServer.h"
|
|
|
|
class CClientLog : public CDialogBase
|
|
{
|
|
DECLARE_DYNAMIC(CClientLog)
|
|
|
|
public:
|
|
CClientLog(CWnd* pParent, Server* pServer, CONTEXT_OBJECT* pContext);
|
|
virtual ~CClientLog();
|
|
|
|
virtual void OnReceiveComplete();
|
|
void AppendLog(const std::string& text);
|
|
|
|
protected:
|
|
virtual BOOL OnInitDialog();
|
|
virtual void DoDataExchange(CDataExchange* pDX);
|
|
afx_msg void OnDestroy();
|
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
afx_msg LRESULT OnReportLog(WPARAM wParam, LPARAM lParam);
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
private:
|
|
CEdit m_editLog;
|
|
CFont m_font;
|
|
|
|
#ifdef AFX_DESIGN_TIME
|
|
enum { IDD = IDD_DIALOG_CLIENT_LOG };
|
|
#endif
|
|
};
|