KiCad PCB EDA Suite
LIB_LOGGER Class Reference

#include <symbol_library_manager.h>

Inheritance diagram for LIB_LOGGER:

Public Member Functions

 LIB_LOGGER ()
 
 ~LIB_LOGGER () override
 
void Activate ()
 
void Deactivate ()
 
void Flush () override
 

Private Attributes

wxLog * m_previousLogger
 
bool m_activated
 

Detailed Description

Definition at line 49 of file symbol_library_manager.h.

Constructor & Destructor Documentation

◆ LIB_LOGGER()

LIB_LOGGER::LIB_LOGGER ( )
inline

Definition at line 52 of file symbol_library_manager.h.

52  :
53  m_previousLogger( nullptr ),
54  m_activated( false )
55  { }

◆ ~LIB_LOGGER()

LIB_LOGGER::~LIB_LOGGER ( )
inlineoverride

Definition at line 57 of file symbol_library_manager.h.

58  {
59  Deactivate();
60  }

References Deactivate().

Member Function Documentation

◆ Activate()

void LIB_LOGGER::Activate ( )
inline

Definition at line 62 of file symbol_library_manager.h.

63  {
64  if( !m_activated )
65  {
66  m_previousLogger = wxLog::GetActiveTarget();
67  wxLog::SetActiveTarget( this );
68  m_activated = true;
69  }
70  }

References m_activated, and m_previousLogger.

Referenced by SYMBOL_LIBRARY_MANAGER::Sync().

◆ Deactivate()

void LIB_LOGGER::Deactivate ( )
inline

Definition at line 72 of file symbol_library_manager.h.

73  {
74  if( m_activated )
75  {
76  Flush();
77  m_activated = false;
78  wxLog::SetActiveTarget( m_previousLogger );
79  }
80  }
void Flush() override

References Flush(), m_activated, and m_previousLogger.

Referenced by SYMBOL_LIBRARY_MANAGER::Sync(), and ~LIB_LOGGER().

◆ Flush()

void LIB_LOGGER::Flush ( )
inlineoverride

Definition at line 82 of file symbol_library_manager.h.

83  {
84  if( m_bHasMessages )
85  {
86  wxLogMessage( _( "Not all symbol libraries could be loaded. Use the Manage Symbol\n"
87  "Libraries dialog to adjust paths and add or remove libraries." ) );
88  wxLogGui::Flush();
89  }
90  }
#define _(s)
Definition: 3d_actions.cpp:33

References _.

Referenced by Deactivate().

Member Data Documentation

◆ m_activated

bool LIB_LOGGER::m_activated
private

Definition at line 94 of file symbol_library_manager.h.

Referenced by Activate(), and Deactivate().

◆ m_previousLogger

wxLog* LIB_LOGGER::m_previousLogger
private

Definition at line 93 of file symbol_library_manager.h.

Referenced by Activate(), and Deactivate().


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