Commit 7d08facb authored by Wayne Stambaugh's avatar Wayne Stambaugh

Convert footpint library log functions to trace functions to reduce debug output.

parent fdc7e9a8
...@@ -56,6 +56,12 @@ using namespace std; ...@@ -56,6 +56,12 @@ using namespace std;
#define FMTIU BOARD_ITEM::FormatInternalUnits #define FMTIU BOARD_ITEM::FormatInternalUnits
/**
* Definition for enabling and disabling footprint library trace output. See the
* wxWidgets documentation on useing the WXTRACE environment variable.
*/
static const wxString traceFootprintLibrary( wxT( "KicadFootprintLib" ) );
/** /**
* Class FP_CACHE_ITEM * Class FP_CACHE_ITEM
...@@ -175,7 +181,8 @@ void FP_CACHE::Save() ...@@ -175,7 +181,8 @@ void FP_CACHE::Save()
// Allow file output stream to go out of scope to close the file stream before // Allow file output stream to go out of scope to close the file stream before
// renaming the file. // renaming the file.
{ {
wxLogDebug( wxT( "Creating temporary library file %s" ), GetChars( tempFileName ) ); wxLogTrace( traceFootprintLibrary, wxT( "Creating temporary library file %s" ),
GetChars( tempFileName ) );
wxFFileOutputStream os( tempFileName ); wxFFileOutputStream os( tempFileName );
...@@ -280,14 +287,15 @@ bool FP_CACHE::IsModified() ...@@ -280,14 +287,15 @@ bool FP_CACHE::IsModified()
if( !fn.FileExists() ) if( !fn.FileExists() )
{ {
wxLogDebug( wxT( "Footprint cache file '%s' does not exist." ), wxLogTrace( traceFootprintLibrary, wxT( "Footprint cache file '%s' does not exist." ),
fn.GetFullPath().GetData() ); fn.GetFullPath().GetData() );
return true; return true;
} }
if( it->second->IsModified() ) if( it->second->IsModified() )
{ {
wxLogDebug( wxT( "Footprint cache file '%s' has been modified." ), wxLogTrace( traceFootprintLibrary,
wxT( "Footprint cache file '%s' has been modified." ),
fn.GetFullPath().GetData() ); fn.GetFullPath().GetData() );
return true; return true;
} }
...@@ -1581,7 +1589,8 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri ...@@ -1581,7 +1589,8 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri
if( it != mods.end() ) if( it != mods.end() )
{ {
wxLogDebug( wxT( "Removing footprint library file '%s'." ), fn.GetFullPath().GetData() ); wxLogTrace( traceFootprintLibrary, wxT( "Removing footprint library file '%s'." ),
fn.GetFullPath().GetData() );
mods.erase( footprintName ); mods.erase( footprintName );
wxRemoveFile( fn.GetFullPath() ); wxRemoveFile( fn.GetFullPath() );
} }
...@@ -1598,7 +1607,8 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri ...@@ -1598,7 +1607,8 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri
if( module->GetLayer() != LAYER_N_FRONT ) if( module->GetLayer() != LAYER_N_FRONT )
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition() );
wxLogDebug( wxT( "Creating s-expression footprint file: %s." ), fn.GetFullPath().GetData() ); wxLogTrace( traceFootprintLibrary, wxT( "Creating s-expression footprint file: %s." ),
fn.GetFullPath().GetData() );
mods.insert( footprintName, new FP_CACHE_ITEM( module, fn ) ); mods.insert( footprintName, new FP_CACHE_ITEM( module, fn ) );
m_cache->Save(); m_cache->Save();
} }
...@@ -1689,7 +1699,8 @@ void PCB_IO::FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* aProp ...@@ -1689,7 +1699,8 @@ void PCB_IO::FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* aProp
} }
} }
wxLogDebug( wxT( "Removing footprint library '%s'" ), aLibraryPath.GetData() ); wxLogTrace( traceFootprintLibrary, wxT( "Removing footprint library '%s'" ),
aLibraryPath.GetData() );
// Some of the more elaborate wxRemoveFile() crap puts up its own wxLog dialog // Some of the more elaborate wxRemoveFile() crap puts up its own wxLog dialog
// we don't want that. we want bare metal portability with no UI here. // we don't want that. we want bare metal portability with no UI here.
......
...@@ -562,8 +562,6 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent ) ...@@ -562,8 +562,6 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent )
wxArrayString libNameList; wxArrayString libNameList;
wxLogDebug( wxT( "Loading legacy footprint library '%s'." ), m_CurrentLib.GetData() );
wxFileName libFileName = m_CurrentLib; wxFileName libFileName = m_CurrentLib;
libFileName.SetExt( FootprintLibFileExtension ); libFileName.SetExt( FootprintLibFileExtension );
...@@ -579,9 +577,6 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent ) ...@@ -579,9 +577,6 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent )
fpInfoList.GetItem( i ).m_Module, fpInfoList.GetItem( i ).m_Module,
true, false ); true, false );
wxLogDebug( wxT( "Saving footprint %s as s-expression to path %s" ),
module->GetLibRef().GetData(), path.GetData() );
pi->FootprintSave( path, module ); pi->FootprintSave( path, module );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment