fix log bloating like whoa (wrap every Trace() in TimingData with DEBUG ifdef)

This commit is contained in:
Mark Cannon
2011-10-07 21:51:04 -04:00
parent 6a393dc6f6
commit d16c77c1b4
+9 -4
View File
@@ -36,8 +36,11 @@ void TimingData::Clear()
vector<TimingSegment*> &vSegs = m_avpTimingSegments[tst];
for( unsigned i = 0; i < vSegs.size(); ++i )
{
//LOG->Trace( "deleting %p", vSegs[i] );
SAFE_DELETE( vSegs[i] ); }
#if defined(DEBUG)
LOG->Trace( "TimingData::Clear(): deleting %p", vSegs[i] );
#endif
SAFE_DELETE( vSegs[i] );
}
vSegs.clear();
}
@@ -312,8 +315,8 @@ TimingSegment* GetSegmentAtRow( int iNoteRow, TimingSegmentType tst )
static void EraseSegment( vector<TimingSegment*> &vSegs, int index, TimingSegment *cur )
{
LOG->Trace( "EraseSegment(%d, %p)", index, cur );
#ifdef DEBUG
LOG->Trace( "EraseSegment(%d, %p)", index, cur );
cur->DebugPrint();
#endif
@@ -325,8 +328,8 @@ static void EraseSegment( vector<TimingSegment*> &vSegs, int index, TimingSegmen
// so we must deep-copy it (with ::Copy) for new allocations.
void TimingData::AddSegment( const TimingSegment *seg )
{
LOG->Trace( "AddSegment( %s )", TimingSegmentTypeToString(seg->GetType()).c_str() );
#ifdef DEBUG
LOG->Trace( "AddSegment( %s )", TimingSegmentTypeToString(seg->GetType()).c_str() );
seg->DebugPrint();
#endif
@@ -390,7 +393,9 @@ void TimingData::AddSegment( const TimingSegment *seg )
// the segment at or before this row is equal to the new one; ignore it
if( bOnSameRow && (*cur) == (*seg) )
{
#if defined(DEBUG)
LOG->Trace( "equals previous segment, ignoring" );
#endif
return;
}