#ifndef LOGCONTROL_H
#define LOGCONTROL_H

#include "InterfaceDefine.hpp"
#include <mutex>

class LogControl : public wxPanel
{
public:
    LogControl(wxWindow* parent);
    ~LogControl() override;

private:
    void Init();

public:
    void AddLog(const wxString& msg);
    template <typename... Args> void AddLog(const wxString& format, Args&&... args)
    {
        wxString msg = wxString::Format(format, std::forward<Args>(args)...);
        AddLog(msg);
    }

public:
    wxListBox* listBox_;
    std::mutex mutex_;
};

#endif   // LOGCONTROL_H