Ember
Loading...
Searching...
No Matches
EmberForge::LogTab Class Reference

Log panel tab that displays application logs with filtering and control capabilities. More...

#include <LogTab.h>

Inheritance diagram for EmberForge::LogTab:
ITab

Public Member Functions

 LogTab (wxWindow *parent)
virtual ~LogTab ()
wxWindow * GetWidget () override
 Returns the wxWidgets window used as the tab content.
wxString GetTitle () const override
 Returns the display title of the tab.
wxString GetTabType () const override
 Returns the tab type identifier.
void Initialize () override
 Called once when the tab is first created.
void Refresh () override
 Refreshes the tab content.
void OnActivated () override
 Called when the tab becomes active.
void OnDeactivated () override
 Called when the tab becomes inactive.
void OnClosed () override
 Called when the tab is closed.
void RefreshLogList ()
void ScrollToBottom ()
void SetLevelFilter (EmberCore::LogLevel level)
void SetCategoryFilter (const wxString &category)
void SetSearchFilter (const wxString &searchText)
void ClearFilters ()
void SetConsoleLoggingEnabled (bool enabled)
void SetFileLoggingEnabled (bool enabled)
void ClearLogs ()
void CopySelectedToClipboard ()
void ExportLogs ()
Public Member Functions inherited from ITab
virtual ~ITab ()=default
virtual wxBitmap GetIcon () const
 Returns the tab icon bitmap; defaults to null.
virtual bool IsValid () const
 Returns true if the tab is in a valid state.
virtual bool CanClose () const
 Returns true if the tab can be closed.
virtual bool CanMove () const
 Returns true if the tab can be moved/reordered.
virtual wxString SerializeState () const
 Serializes tab state to a string for persistence.
virtual void DeserializeState (const wxString &state)
 Restores tab state from a serialized string.
virtual bool HasUnsavedChanges () const
 Returns true if the tab has unsaved changes.
virtual bool Save ()
 Saves the tab content; returns true on success.
virtual bool SupportsOperation (const wxString &operation) const
 Returns true if the tab supports the given operation.
virtual bool ExecuteOperation (const wxString &operation, const wxString &parameter="")
 Executes an operation with optional parameter; returns true on success.

Private Types

enum  {
  ID_LEVEL_FILTER = wxID_HIGHEST + 1 , ID_CATEGORY_FILTER , ID_SEARCH_CTRL , ID_AUTO_SCROLL ,
  ID_PAUSE_BTN , ID_CONSOLE_CHECK , ID_FILE_CHECK , ID_CLEAR_BTN ,
  ID_COPY_BTN , ID_EXPORT_BTN , ID_LOG_LIST
}

Private Member Functions

void LoadSettings ()
void CreateLayout ()
void CreateToolbar ()
void CreateLogList ()
void SetupEventHandlers ()
void OnLevelFilterChanged (wxCommandEvent &event)
void OnCategoryFilterChanged (wxCommandEvent &event)
void OnSearchTextChanged (wxCommandEvent &event)
void OnAutoScrollToggled (wxCommandEvent &event)
void OnConsoleToggled (wxCommandEvent &event)
void OnFileToggled (wxCommandEvent &event)
void OnClearClicked (wxCommandEvent &event)
void OnCopyClicked (wxCommandEvent &event)
void OnExportClicked (wxCommandEvent &event)
void OnListItemSelected (wxListEvent &event)
void OnListItemRightClick (wxListEvent &event)
void OnLogUpdated ()
void OnPauseToggled (wxCommandEvent &event)
void UpdatePauseButtonAppearance ()
void UpdateLogCountDisplay ()
wxColour GetLevelColor (EmberCore::LogLevel level) const
wxString GetLevelString (EmberCore::LogLevel level) const
void PopulateList (const std::vector< std::shared_ptr< EmberCore::LogEntry > > &entries)
void UpdateCategoryChoices ()
wxString FormatTimestamp (const std::chrono::system_clock::time_point &timestamp) const
 wxDECLARE_EVENT_TABLE ()

Private Attributes

wxChoice * m_levelFilter
wxComboBox * m_categoryFilter
wxSearchCtrl * m_searchCtrl
wxCheckBox * m_autoScrollCheck
wxButton * m_pauseBtn
wxCheckBox * m_consoleCheck
wxCheckBox * m_fileCheck
wxButton * m_clearBtn
wxButton * m_copyBtn
wxButton * m_exportBtn
wxStaticText * m_logCountLabel
VirtualLogListCtrlm_logList
EmberCore::LogLevel m_currentLevelFilter
wxString m_currentCategoryFilter
wxString m_currentSearchFilter
bool m_autoScroll
bool m_paused
bool m_updatingCategories
std::vector< std::shared_ptr< EmberCore::LogEntry > > m_filteredEntries
std::set< std::string > m_knownCategories
EmberCore::Logger::ObserverId m_observerId

Friends

class VirtualLogListCtrl

Detailed Description

Log panel tab that displays application logs with filtering and control capabilities.

Features:

  • Log display with color-coded levels (using virtual list for performance)
  • Filter by level, category, and search text
  • Control console and file logging output
  • Clear, copy, and export functionality
  • Auto-scroll to latest entries

Definition at line 51 of file LogTab.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_LEVEL_FILTER 
ID_CATEGORY_FILTER 
ID_SEARCH_CTRL 
ID_AUTO_SCROLL 
ID_PAUSE_BTN 
ID_CONSOLE_CHECK 
ID_FILE_CHECK 
ID_CLEAR_BTN 
ID_COPY_BTN 
ID_EXPORT_BTN 
ID_LOG_LIST 

Definition at line 154 of file LogTab.h.

Constructor & Destructor Documentation

◆ LogTab()

EmberForge::LogTab::LogTab ( wxWindow * parent)

◆ ~LogTab()

EmberForge::LogTab::~LogTab ( )
virtual

Definition at line 105 of file LogTab.cpp.

Member Function Documentation

◆ ClearFilters()

void EmberForge::LogTab::ClearFilters ( )

Definition at line 449 of file LogTab.cpp.

◆ ClearLogs()

void EmberForge::LogTab::ClearLogs ( )

Definition at line 469 of file LogTab.cpp.

◆ CopySelectedToClipboard()

void EmberForge::LogTab::CopySelectedToClipboard ( )

Definition at line 475 of file LogTab.cpp.

◆ CreateLayout()

void EmberForge::LogTab::CreateLayout ( )
private

Definition at line 162 of file LogTab.cpp.

◆ CreateLogList()

void EmberForge::LogTab::CreateLogList ( )
private

Definition at line 272 of file LogTab.cpp.

◆ CreateToolbar()

void EmberForge::LogTab::CreateToolbar ( )
private

Definition at line 268 of file LogTab.cpp.

◆ ExportLogs()

void EmberForge::LogTab::ExportLogs ( )

Definition at line 507 of file LogTab.cpp.

◆ FormatTimestamp()

wxString EmberForge::LogTab::FormatTimestamp ( const std::chrono::system_clock::time_point & timestamp) const
private

Definition at line 345 of file LogTab.cpp.

◆ GetLevelColor()

wxColour EmberForge::LogTab::GetLevelColor ( EmberCore::LogLevel level) const
private

Definition at line 361 of file LogTab.cpp.

◆ GetLevelString()

wxString EmberForge::LogTab::GetLevelString ( EmberCore::LogLevel level) const
private

Definition at line 387 of file LogTab.cpp.

◆ GetTabType()

wxString EmberForge::LogTab::GetTabType ( ) const
inlineoverridevirtual

Returns the tab type identifier.

Implements ITab.

Definition at line 59 of file LogTab.h.

◆ GetTitle()

wxString EmberForge::LogTab::GetTitle ( ) const
inlineoverridevirtual

Returns the display title of the tab.

Implements ITab.

Definition at line 58 of file LogTab.h.

◆ GetWidget()

wxWindow * EmberForge::LogTab::GetWidget ( )
inlineoverridevirtual

Returns the wxWidgets window used as the tab content.

Implements ITab.

Definition at line 57 of file LogTab.h.

◆ Initialize()

void EmberForge::LogTab::Initialize ( )
overridevirtual

Called once when the tab is first created.

Reimplemented from ITab.

Definition at line 112 of file LogTab.cpp.

◆ LoadSettings()

void EmberForge::LogTab::LoadSettings ( )
private

Definition at line 131 of file LogTab.cpp.

◆ OnActivated()

void EmberForge::LogTab::OnActivated ( )
overridevirtual

Called when the tab becomes active.

Reimplemented from ITab.

Definition at line 418 of file LogTab.cpp.

◆ OnAutoScrollToggled()

void EmberForge::LogTab::OnAutoScrollToggled ( wxCommandEvent & event)
private

Definition at line 561 of file LogTab.cpp.

◆ OnCategoryFilterChanged()

void EmberForge::LogTab::OnCategoryFilterChanged ( wxCommandEvent & event)
private

Definition at line 546 of file LogTab.cpp.

◆ OnClearClicked()

void EmberForge::LogTab::OnClearClicked ( wxCommandEvent & event)
private

Definition at line 572 of file LogTab.cpp.

◆ OnClosed()

void EmberForge::LogTab::OnClosed ( )
overridevirtual

Called when the tab is closed.

Reimplemented from ITab.

Definition at line 424 of file LogTab.cpp.

◆ OnConsoleToggled()

void EmberForge::LogTab::OnConsoleToggled ( wxCommandEvent & event)
private

Definition at line 568 of file LogTab.cpp.

◆ OnCopyClicked()

void EmberForge::LogTab::OnCopyClicked ( wxCommandEvent & event)
private

Definition at line 574 of file LogTab.cpp.

◆ OnDeactivated()

void EmberForge::LogTab::OnDeactivated ( )
overridevirtual

Called when the tab becomes inactive.

Reimplemented from ITab.

Definition at line 420 of file LogTab.cpp.

◆ OnExportClicked()

void EmberForge::LogTab::OnExportClicked ( wxCommandEvent & event)
private

Definition at line 576 of file LogTab.cpp.

◆ OnFileToggled()

void EmberForge::LogTab::OnFileToggled ( wxCommandEvent & event)
private

Definition at line 570 of file LogTab.cpp.

◆ OnLevelFilterChanged()

void EmberForge::LogTab::OnLevelFilterChanged ( wxCommandEvent & event)
private

Definition at line 540 of file LogTab.cpp.

◆ OnListItemRightClick()

void EmberForge::LogTab::OnListItemRightClick ( wxListEvent & event)
private

Definition at line 582 of file LogTab.cpp.

◆ OnListItemSelected()

void EmberForge::LogTab::OnListItemSelected ( wxListEvent & event)
private

Definition at line 578 of file LogTab.cpp.

◆ OnLogUpdated()

void EmberForge::LogTab::OnLogUpdated ( )
private

Definition at line 595 of file LogTab.cpp.

◆ OnPauseToggled()

void EmberForge::LogTab::OnPauseToggled ( wxCommandEvent & event)
private

Definition at line 603 of file LogTab.cpp.

◆ OnSearchTextChanged()

void EmberForge::LogTab::OnSearchTextChanged ( wxCommandEvent & event)
private

Definition at line 556 of file LogTab.cpp.

◆ PopulateList()

void EmberForge::LogTab::PopulateList ( const std::vector< std::shared_ptr< EmberCore::LogEntry > > & entries)
private

Definition at line 303 of file LogTab.cpp.

◆ Refresh()

void EmberForge::LogTab::Refresh ( )
overridevirtual

Refreshes the tab content.

Reimplemented from ITab.

Definition at line 410 of file LogTab.cpp.

◆ RefreshLogList()

void EmberForge::LogTab::RefreshLogList ( )

Definition at line 282 of file LogTab.cpp.

◆ ScrollToBottom()

void EmberForge::LogTab::ScrollToBottom ( )

Definition at line 404 of file LogTab.cpp.

◆ SetCategoryFilter()

void EmberForge::LogTab::SetCategoryFilter ( const wxString & category)

Definition at line 439 of file LogTab.cpp.

◆ SetConsoleLoggingEnabled()

void EmberForge::LogTab::SetConsoleLoggingEnabled ( bool enabled)

Definition at line 462 of file LogTab.cpp.

◆ SetFileLoggingEnabled()

void EmberForge::LogTab::SetFileLoggingEnabled ( bool enabled)

Definition at line 466 of file LogTab.cpp.

◆ SetLevelFilter()

void EmberForge::LogTab::SetLevelFilter ( EmberCore::LogLevel level)

Definition at line 434 of file LogTab.cpp.

◆ SetSearchFilter()

void EmberForge::LogTab::SetSearchFilter ( const wxString & searchText)

Definition at line 444 of file LogTab.cpp.

◆ SetupEventHandlers()

void EmberForge::LogTab::SetupEventHandlers ( )
private

Definition at line 278 of file LogTab.cpp.

◆ UpdateCategoryChoices()

void EmberForge::LogTab::UpdateCategoryChoices ( )
private

Definition at line 311 of file LogTab.cpp.

◆ UpdateLogCountDisplay()

void EmberForge::LogTab::UpdateLogCountDisplay ( )
private

Definition at line 628 of file LogTab.cpp.

◆ UpdatePauseButtonAppearance()

void EmberForge::LogTab::UpdatePauseButtonAppearance ( )
private

Definition at line 613 of file LogTab.cpp.

◆ wxDECLARE_EVENT_TABLE()

EmberForge::LogTab::wxDECLARE_EVENT_TABLE ( )
private

◆ VirtualLogListCtrl

friend class VirtualLogListCtrl
friend

Definition at line 138 of file LogTab.h.

Member Data Documentation

◆ m_autoScroll

bool EmberForge::LogTab::m_autoScroll
private

Definition at line 144 of file LogTab.h.

◆ m_autoScrollCheck

wxCheckBox* EmberForge::LogTab::m_autoScrollCheck
private

Definition at line 123 of file LogTab.h.

◆ m_categoryFilter

wxComboBox* EmberForge::LogTab::m_categoryFilter
private

Definition at line 121 of file LogTab.h.

◆ m_clearBtn

wxButton* EmberForge::LogTab::m_clearBtn
private

Definition at line 129 of file LogTab.h.

◆ m_consoleCheck

wxCheckBox* EmberForge::LogTab::m_consoleCheck
private

Definition at line 127 of file LogTab.h.

◆ m_copyBtn

wxButton* EmberForge::LogTab::m_copyBtn
private

Definition at line 130 of file LogTab.h.

◆ m_currentCategoryFilter

wxString EmberForge::LogTab::m_currentCategoryFilter
private

Definition at line 142 of file LogTab.h.

◆ m_currentLevelFilter

EmberCore::LogLevel EmberForge::LogTab::m_currentLevelFilter
private

Definition at line 141 of file LogTab.h.

◆ m_currentSearchFilter

wxString EmberForge::LogTab::m_currentSearchFilter
private

Definition at line 143 of file LogTab.h.

◆ m_exportBtn

wxButton* EmberForge::LogTab::m_exportBtn
private

Definition at line 131 of file LogTab.h.

◆ m_fileCheck

wxCheckBox* EmberForge::LogTab::m_fileCheck
private

Definition at line 128 of file LogTab.h.

◆ m_filteredEntries

std::vector<std::shared_ptr<EmberCore::LogEntry> > EmberForge::LogTab::m_filteredEntries
private

Definition at line 147 of file LogTab.h.

◆ m_knownCategories

std::set<std::string> EmberForge::LogTab::m_knownCategories
private

Definition at line 148 of file LogTab.h.

◆ m_levelFilter

wxChoice* EmberForge::LogTab::m_levelFilter
private

Definition at line 120 of file LogTab.h.

◆ m_logCountLabel

wxStaticText* EmberForge::LogTab::m_logCountLabel
private

Definition at line 132 of file LogTab.h.

◆ m_logList

VirtualLogListCtrl* EmberForge::LogTab::m_logList
private

Definition at line 135 of file LogTab.h.

◆ m_observerId

EmberCore::Logger::ObserverId EmberForge::LogTab::m_observerId
private

Definition at line 151 of file LogTab.h.

◆ m_pauseBtn

wxButton* EmberForge::LogTab::m_pauseBtn
private

Definition at line 124 of file LogTab.h.

◆ m_paused

bool EmberForge::LogTab::m_paused
private

Definition at line 145 of file LogTab.h.

◆ m_searchCtrl

wxSearchCtrl* EmberForge::LogTab::m_searchCtrl
private

Definition at line 122 of file LogTab.h.

◆ m_updatingCategories

bool EmberForge::LogTab::m_updatingCategories
private

Definition at line 146 of file LogTab.h.


The documentation for this class was generated from the following files: