KiCad PCB EDA Suite
LIB_LOGGER Class Reference

#include <lib_logger.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 32 of file lib_logger.h.

Constructor & Destructor Documentation

◆ LIB_LOGGER()

LIB_LOGGER::LIB_LOGGER ( )

Definition at line 30 of file lib_logger.cpp.

30 : m_previousLogger( nullptr ), m_activated( false )
31{
32}
wxLog * m_previousLogger
Definition: lib_logger.h:46
bool m_activated
Definition: lib_logger.h:47

◆ ~LIB_LOGGER()

LIB_LOGGER::~LIB_LOGGER ( )
override

Definition at line 34 of file lib_logger.cpp.

35{
36 Deactivate();
37}
void Deactivate()
Definition: lib_logger.cpp:49

References Deactivate().

Member Function Documentation

◆ Activate()

void LIB_LOGGER::Activate ( )

Definition at line 39 of file lib_logger.cpp.

40{
41 if( !m_activated )
42 {
43 m_previousLogger = wxLog::GetActiveTarget();
44 wxLog::SetActiveTarget( this );
45 m_activated = true;
46 }
47}

References m_activated, and m_previousLogger.

Referenced by SYMBOL_LIBRARY_MANAGER::Sync().

◆ Deactivate()

void LIB_LOGGER::Deactivate ( )

Definition at line 49 of file lib_logger.cpp.

50{
51 if( m_activated )
52 {
53 Flush();
54 m_activated = false;
55 wxLog::SetActiveTarget( m_previousLogger );
56 }
57}
void Flush() override
Definition: lib_logger.cpp:60

References Flush(), m_activated, and m_previousLogger.

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

◆ Flush()

void LIB_LOGGER::Flush ( )
override

Definition at line 60 of file lib_logger.cpp.

61{
62 if( m_bHasMessages )
63 {
64 wxLogMessage( _( "Not all symbol libraries could be loaded. Use the Manage Symbol\n"
65 "Libraries dialog to adjust paths and add or remove libraries." ) );
66 wxLogGui::Flush();
67 }
68}
#define _(s)

References _.

Referenced by Deactivate().

Member Data Documentation

◆ m_activated

bool LIB_LOGGER::m_activated
private

Definition at line 47 of file lib_logger.h.

Referenced by Activate(), and Deactivate().

◆ m_previousLogger

wxLog* LIB_LOGGER::m_previousLogger
private

Definition at line 46 of file lib_logger.h.

Referenced by Activate(), and Deactivate().


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