From d16c77c1b48d166bd011da37ce28ef2edf8c4a42 Mon Sep 17 00:00:00 2001 From: Mark Cannon Date: Fri, 7 Oct 2011 21:51:04 -0400 Subject: [PATCH] fix log bloating like whoa (wrap every Trace() in TimingData with DEBUG ifdef) --- src/TimingData.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/TimingData.cpp b/src/TimingData.cpp index a14043772f..41994f3a39 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -36,8 +36,11 @@ void TimingData::Clear() vector &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 &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 &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; }