Changed PNS logging routine to wxLogTrace

This commit is contained in:
Maciej Suminski 2016-08-17 16:00:21 +02:00
parent 9f0b42cb35
commit 78050c05e2
17 changed files with 52 additions and 118 deletions

View File

@ -41,8 +41,6 @@
#include "length_tuner_tool.h" #include "length_tuner_tool.h"
#include "trace.h"
using namespace KIGFX; using namespace KIGFX;
using boost::optional; using boost::optional;

View File

@ -22,8 +22,6 @@
#include <class_board_item.h> #include <class_board_item.h>
#include <class_netinfo.h> #include <class_netinfo.h>
#include "trace.h"
#include "pns_node.h" #include "pns_node.h"
#include "pns_walkaround.h" #include "pns_walkaround.h"
#include "pns_shove.h" #include "pns_shove.h"

View File

@ -22,8 +22,6 @@
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
#include "trace.h"
#include "pns_node.h" #include "pns_node.h"
#include "pns_itemset.h" #include "pns_itemset.h"
#include "pns_topology.h" #include "pns_topology.h"

View File

@ -112,7 +112,7 @@ bool PNS_DRAGGER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
aStartItem->Unmark( MK_LOCKED ); aStartItem->Unmark( MK_LOCKED );
TRACE( 2, "StartDragging: item %p [kind %d]", aStartItem % aStartItem->Kind() ); wxLogTrace( "PNS", "StartDragging: item %p [kind %d]", aStartItem, aStartItem->Kind() );
switch( aStartItem->Kind() ) switch( aStartItem->Kind() )
{ {

View File

@ -26,8 +26,6 @@
#include <geometry/shape.h> #include <geometry/shape.h>
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include "trace.h"
#include "pns_layerset.h" #include "pns_layerset.h"
class BOARD_CONNECTED_ITEM; class BOARD_CONNECTED_ITEM;

View File

@ -120,8 +120,7 @@ PNS_PCBNEW_RULE_RESOLVER::PNS_PCBNEW_RULE_RESOLVER( BOARD* aBoard, PNS_ROUTER* a
ent.clearance = clearance; ent.clearance = clearance;
m_clearanceCache[i] = ent; m_clearanceCache[i] = ent;
TRACE( 1, "Add net %d netclass %s clearance %d", i % netClassName.mb_str() % wxLogTrace( "PNS", "Add net %d netclass %s clearance %d", i, netClassName.mb_str(), clearance );
clearance );
} }
m_overrideEnabled = false; m_overrideEnabled = false;
@ -467,7 +466,7 @@ PNS_ITEM* PNS_KICAD_IFACE::syncPad( D_PAD* aPad )
break; break;
default: default:
TRACE( 0, "unsupported pad type 0x%x", aPad->GetAttribute() ); wxLogTrace( "PNS", "unsupported pad type 0x%x", aPad->GetAttribute() );
return NULL; return NULL;
} }
@ -562,7 +561,7 @@ PNS_ITEM* PNS_KICAD_IFACE::syncPad( D_PAD* aPad )
break; break;
default: default:
TRACEn( 0, "unsupported pad shape" ); wxLogTrace( "PNS", "unsupported pad shape" );
delete solid; delete solid;
return NULL; return NULL;
} }
@ -659,7 +658,7 @@ PNS_ITEM* PNS_KICAD_IFACE::syncPad( D_PAD* aPad )
} }
default: default:
TRACEn( 0, "unsupported pad shape" ); wxLogTrace( "PNS", "unsupported pad shape" );
delete solid; delete solid;
return NULL; return NULL;
@ -703,7 +702,7 @@ PNS_ITEM* PNS_KICAD_IFACE::syncVia( VIA* aVia )
void PNS_KICAD_IFACE::SetBoard( BOARD* aBoard ) void PNS_KICAD_IFACE::SetBoard( BOARD* aBoard )
{ {
m_board = aBoard; m_board = aBoard;
TRACE( 1, "m_board = %p\n", m_board ); wxLogTrace( "PNS", "m_board = %p\n", m_board );
} }
@ -711,7 +710,7 @@ void PNS_KICAD_IFACE::SyncWorld( PNS_NODE *aWorld )
{ {
if( !m_board ) if( !m_board )
{ {
TRACEn( 0, "No board attached, aborting sync." ); wxLogTrace( "PNS", "No board attached, aborting sync." );
return; return;
} }

View File

@ -345,7 +345,7 @@ void PNS_LINE::ShowLinks()
return; return;
} }
wxLogTrace( "PNS", "line %p: %d linked segs\n", this, (int) m_segmentRefs->size() ); wxLogTrace( "PNS", "line %p: %lu linked segs\n", this, (int) m_segmentRefs->size() );
for( int i = 0; i < (int) m_segmentRefs->size(); i++ ) for( int i = 0; i < (int) m_segmentRefs->size(); i++ )
wxLogTrace( "PNS", "seg %d: %p\n", i, (*m_segmentRefs)[i] ); wxLogTrace( "PNS", "seg %d: %p\n", i, (*m_segmentRefs)[i] );

View File

@ -20,8 +20,6 @@
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include "trace.h"
#include "pns_node.h" #include "pns_node.h"
#include "pns_line_placer.h" #include "pns_line_placer.h"
#include "pns_walkaround.h" #include "pns_walkaround.h"
@ -195,8 +193,8 @@ bool PNS_LINE_PLACER::handlePullback()
m_direction = DIRECTION_45( last ); m_direction = DIRECTION_45( last );
m_p_start = last.A; m_p_start = last.A;
TRACE( 0, "Placer: pullback triggered [%d] [%s %s]", wxLogTrace( "PNS", "Placer: pullback triggered [%d] [%s %s]",
n % last_tail.Format().c_str() % first_head.Format().c_str() ); n, last_tail.Format().c_str(), first_head.Format().c_str() );
// erase the last point in the tail, hoping that the next iteration will // erase the last point in the tail, hoping that the next iteration will
// result with a head trace that starts with a segment following our // result with a head trace that starts with a segment following our
@ -261,7 +259,7 @@ bool PNS_LINE_PLACER::reduceTail( const VECTOR2I& aEnd )
if( reduce_index >= 0 ) if( reduce_index >= 0 )
{ {
TRACE( 0, "Placer: reducing tail: %d", reduce_index ); wxLogTrace( "PNS", "Placer: reducing tail: %d", reduce_index );
SHAPE_LINE_CHAIN reducedLine = new_direction.BuildInitialTrace( new_start, aEnd ); SHAPE_LINE_CHAIN reducedLine = new_direction.BuildInitialTrace( new_start, aEnd );
m_p_start = new_start; m_p_start = new_start;
@ -304,13 +302,13 @@ bool PNS_LINE_PLACER::mergeHead()
if( n_head < 3 ) if( n_head < 3 )
{ {
TRACEn( 4, "Merge failed: not enough head segs." ); wxLogTrace( "PNS", "Merge failed: not enough head segs." );
return false; return false;
} }
if( n_tail && head.CPoint( 0 ) != tail.CPoint( -1 ) ) if( n_tail && head.CPoint( 0 ) != tail.CPoint( -1 ) )
{ {
TRACEn( 4, "Merge failed: head and tail discontinuous." ); wxLogTrace( "PNS", "Merge failed: head and tail discontinuous." );
return false; return false;
} }
@ -346,7 +344,7 @@ bool PNS_LINE_PLACER::mergeHead()
head.Remove( 0, n_head - 2 ); head.Remove( 0, n_head - 2 );
TRACE( 0, "Placer: merge %d, new direction: %s", n_head % m_direction.Format().c_str() ); wxLogTrace( "PNS", "Placer: merge %d, new direction: %s", n_head, m_direction.Format().c_str() );
head.Simplify(); head.Simplify();
tail.Simplify(); tail.Simplify();
@ -574,7 +572,7 @@ bool PNS_LINE_PLACER::optimizeTailHeadTransition()
{ {
PNS_LINE tmp( m_tail, opt_line ); PNS_LINE tmp( m_tail, opt_line );
TRACE( 0, "Placer: optimize tail-head [%d]", threshold ); wxLogTrace( "PNS", "Placer: optimize tail-head [%d]", threshold );
head.Clear(); head.Clear();
tail.Replace( -threshold, -1, new_head.CLine() ); tail.Replace( -threshold, -1, new_head.CLine() );
@ -599,9 +597,8 @@ void PNS_LINE_PLACER::routeStep( const VECTOR2I& aP )
PNS_LINE new_head; PNS_LINE new_head;
TRACE( 2, "INIT-DIR: %s head: %d, tail: %d segs\n", wxLogTrace( "PNS", "INIT-DIR: %s head: %d, tail: %d segs\n",
m_initial_direction.Format().c_str() % m_head.SegmentCount() % m_initial_direction.Format().c_str(), m_head.SegmentCount(), m_tail.SegmentCount() );
m_tail.SegmentCount() );
for( i = 0; i < n_iter; i++ ) for( i = 0; i < n_iter; i++ )
{ {
@ -789,8 +786,8 @@ void PNS_LINE_PLACER::initPlacement()
setWorld( rootNode ); setWorld( rootNode );
TRACE( 1, "world %p, intitial-direction %s layer %d\n", wxLogTrace( "PNS", "world %p, intitial-direction %s layer %d\n",
m_world % m_direction.Format().c_str() % aLayer ); m_world, m_direction.Format().c_str(), m_currentLayer );
m_lastNode = NULL; m_lastNode = NULL;
m_currentNode = m_world; m_currentNode = m_world;
@ -977,7 +974,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE& aLatest )
} }
} }
TRACE( 0, "total segs removed: %d/%d\n", removedCount % total ); wxLogTrace( "PNS", "total segs removed: %d/%d\n", removedCount, total );
} }
for( PNS_SEGMENT *s : toErase ) for( PNS_SEGMENT *s : toErase )

View File

@ -20,8 +20,6 @@
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
#include "trace.h"
#include "pns_node.h" #include "pns_node.h"
#include "pns_itemset.h" #include "pns_itemset.h"
#include "pns_topology.h" #include "pns_topology.h"

View File

@ -20,8 +20,6 @@
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
#include "trace.h"
#include "pns_node.h" #include "pns_node.h"
#include "pns_itemset.h" #include "pns_itemset.h"
#include "pns_topology.h" #include "pns_topology.h"

View File

@ -20,8 +20,6 @@
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
#include "trace.h"
#include "pns_node.h" #include "pns_node.h"
#include "pns_itemset.h" #include "pns_itemset.h"
#include "pns_topology.h" #include "pns_topology.h"

View File

@ -28,7 +28,6 @@
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include <geometry/shape_index.h> #include <geometry/shape_index.h>
#include "trace.h"
#include "pns_item.h" #include "pns_item.h"
#include "pns_line.h" #include "pns_line.h"
#include "pns_node.h" #include "pns_node.h"
@ -47,7 +46,7 @@ static boost::unordered_set<PNS_NODE*> allocNodes;
PNS_NODE::PNS_NODE() PNS_NODE::PNS_NODE()
{ {
TRACE( 0, "PNS_NODE::create %p", this ); wxLogTrace( "PNS", "PNS_NODE::create %p", this );
m_depth = 0; m_depth = 0;
m_root = this; m_root = this;
m_parent = NULL; m_parent = NULL;
@ -63,18 +62,18 @@ PNS_NODE::PNS_NODE()
PNS_NODE::~PNS_NODE() PNS_NODE::~PNS_NODE()
{ {
TRACE( 0, "PNS_NODE::delete %p", this ); wxLogTrace( "PNS", "PNS_NODE::delete %p", this );
if( !m_children.empty() ) if( !m_children.empty() )
{ {
TRACEn( 0, "attempting to free a node that has kids.\n" ); wxLogTrace( "PNS", "attempting to free a node that has kids.\n" );
assert( false ); assert( false );
} }
#ifdef DEBUG #ifdef DEBUG
if( allocNodes.find( this ) == allocNodes.end() ) if( allocNodes.find( this ) == allocNodes.end() )
{ {
TRACEn( 0, "attempting to free an already-free'd node.\n" ); wxLogTrace( "PNS", "attempting to free an already-free'd node.\n" );
assert( false ); assert( false );
} }
@ -108,7 +107,7 @@ PNS_NODE* PNS_NODE::Branch()
{ {
PNS_NODE* child = new PNS_NODE; PNS_NODE* child = new PNS_NODE;
TRACE( 0, "PNS_NODE::branch %p (parent %p)", child % this ); wxLogTrace( "PNS", "PNS_NODE::branch %p (parent %p)", child, this );
m_children.insert( child ); m_children.insert( child );
@ -131,8 +130,8 @@ PNS_NODE* PNS_NODE::Branch()
child->m_override = m_override; child->m_override = m_override;
} }
TRACE( 2, "%d items, %d joints, %d overrides", wxLogTrace( "PNS", "%d items, %lu joints, %lu overrides",
child->m_index->Size() % child->m_joints.size() % child->m_override.size() ); child->m_index->Size(), child->m_joints.size(), child->m_override.size() );
return child; return child;
} }
@ -583,7 +582,7 @@ void PNS_NODE::addSegment( PNS_SEGMENT* aSeg, bool aAllowRedundant )
{ {
if( aSeg->Seg().A == aSeg->Seg().B ) if( aSeg->Seg().A == aSeg->Seg().B )
{ {
TRACEn( 0, "attempting to add a segment with same end coordinates, ignoring." ) wxLogTrace( "PNS", "attempting to add a segment with same end coordinates, ignoring." );
return; return;
} }

View File

@ -33,7 +33,6 @@
#include <geometry/shape_rect.h> #include <geometry/shape_rect.h>
#include <geometry/shape_circle.h> #include <geometry/shape_circle.h>
#include "trace.h"
#include "pns_node.h" #include "pns_node.h"
#include "pns_line_placer.h" #include "pns_line_placer.h"
#include "pns_line.h" #include "pns_line.h"

View File

@ -23,7 +23,6 @@
#include <deque> #include <deque>
#include <cassert> #include <cassert>
#include "trace.h"
#include "range.h" #include "range.h"
#include "pns_line.h" #include "pns_line.h"
@ -191,19 +190,19 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::processHullSet( PNS_LINE& aCurrent, PNS_LINE&
if( ( vFirst < 0 || vLast < 0 ) && !path.CompareGeometry( aObstacle.CLine() ) ) if( ( vFirst < 0 || vLast < 0 ) && !path.CompareGeometry( aObstacle.CLine() ) )
{ {
TRACE( 100, "attempt %d fail vfirst-last", attempt ); wxLogTrace( "PNS", "attempt %d fail vfirst-last", attempt );
continue; continue;
} }
if( path.CPoint( -1 ) != obs.CPoint( -1 ) || path.CPoint( 0 ) != obs.CPoint( 0 ) ) if( path.CPoint( -1 ) != obs.CPoint( -1 ) || path.CPoint( 0 ) != obs.CPoint( 0 ) )
{ {
TRACE( 100, "attempt %d fail vend-start\n", attempt ); wxLogTrace( "PNS", "attempt %d fail vend-start\n", attempt );
continue; continue;
} }
if( !checkBumpDirection( aCurrent, l ) ) if( !checkBumpDirection( aCurrent, l ) )
{ {
TRACE( 100, "attempt %d fail direction-check", attempt ); wxLogTrace( "PNS", "attempt %d fail direction-check", attempt );
aShoved.SetShape( l.CLine() ); aShoved.SetShape( l.CLine() );
continue; continue;
@ -211,7 +210,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::processHullSet( PNS_LINE& aCurrent, PNS_LINE&
if( path.SelfIntersecting() ) if( path.SelfIntersecting() )
{ {
TRACE( 100, "attempt %d fail self-intersect", attempt ); wxLogTrace( "PNS", "attempt %d fail self-intersect", attempt );
continue; continue;
} }
@ -230,7 +229,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::processHullSet( PNS_LINE& aCurrent, PNS_LINE&
if( colliding ) if( colliding )
{ {
TRACE( 100, "attempt %d fail coll-check", attempt ); wxLogTrace( "PNS", "attempt %d fail coll-check", attempt );
continue; continue;
} }
@ -587,7 +586,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc
if( !jt ) if( !jt )
{ {
TRACEn( 1, "weird, can't find the center-of-via joint\n" ); wxLogTrace( "PNS", "weird, can't find the center-of-via joint\n" );
return SH_INCOMPLETE; return SH_INCOMPLETE;
} }
@ -949,7 +948,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter )
case PNS_ITEM::VIA: case PNS_ITEM::VIA:
{ {
PNS_VIA* revVia = (PNS_VIA*) ni; PNS_VIA* revVia = (PNS_VIA*) ni;
TRACE( 2, "iter %d: reverse-collide-via", aIter ); wxLogTrace( "PNS", "iter %d: reverse-collide-via", aIter );
if( currentLine.EndsWithVia() && m_currentNode->CheckColliding( &currentLine.Via(), revVia ) ) if( currentLine.EndsWithVia() && m_currentNode->CheckColliding( &currentLine.Via(), revVia ) )
{ {
@ -966,7 +965,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter )
case PNS_ITEM::SEGMENT: case PNS_ITEM::SEGMENT:
{ {
PNS_SEGMENT* seg = (PNS_SEGMENT*) ni; PNS_SEGMENT* seg = (PNS_SEGMENT*) ni;
TRACE( 2, "iter %d: reverse-collide-segment ", aIter ); wxLogTrace( "PNS", "iter %d: reverse-collide-segment ", aIter );
PNS_LINE revLine = assembleLine( seg ); PNS_LINE revLine = assembleLine( seg );
popLine(); popLine();
@ -986,7 +985,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter )
switch( ni->Kind() ) switch( ni->Kind() )
{ {
case PNS_ITEM::SEGMENT: case PNS_ITEM::SEGMENT:
TRACE( 2, "iter %d: collide-segment ", aIter ); wxLogTrace( "PNS", "iter %d: collide-segment ", aIter );
st = onCollidingSegment( currentLine, (PNS_SEGMENT*) ni ); st = onCollidingSegment( currentLine, (PNS_SEGMENT*) ni );
@ -997,7 +996,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter )
break; break;
case PNS_ITEM::VIA: case PNS_ITEM::VIA:
TRACE( 2, "iter %d: shove-via ", aIter ); wxLogTrace( "PNS", "iter %d: shove-via ", aIter );
st = onCollidingVia( &currentLine, (PNS_VIA*) ni ); st = onCollidingVia( &currentLine, (PNS_VIA*) ni );
if( st == SH_TRY_WALK ) if( st == SH_TRY_WALK )
@ -1007,7 +1006,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter )
break; break;
case PNS_ITEM::SOLID: case PNS_ITEM::SOLID:
TRACE( 2, "iter %d: walk-solid ", aIter ); wxLogTrace( "PNS", "iter %d: walk-solid ", aIter );
st = onCollidingSolid( currentLine, (PNS_SOLID*) ni ); st = onCollidingSolid( currentLine, (PNS_SOLID*) ni );
break; break;
@ -1026,7 +1025,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveMainLoop()
m_affectedAreaSum = OPT_BOX2I(); m_affectedAreaSum = OPT_BOX2I();
TRACE( 1, "ShoveStart [root: %d jts, current: %d jts]", m_root->JointCount() % wxLogTrace( "PNS", "ShoveStart [root: %d jts, current: %d jts]", m_root->JointCount(),
m_currentNode->JointCount() ); m_currentNode->JointCount() );
int iterLimit = Settings().ShoveIterationLimit(); int iterLimit = Settings().ShoveIterationLimit();
@ -1144,8 +1143,8 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead )
m_currentNode->RemoveByMarker( MK_HEAD ); m_currentNode->RemoveByMarker( MK_HEAD );
TRACE( 1, "Shove status : %s after %d iterations", wxLogTrace( "PNS", "Shove status : %s after %d iterations",
( ( st == SH_OK || st == SH_HEAD_MODIFIED ) ? "OK" : "FAILURE") % m_iter ); ( ( st == SH_OK || st == SH_HEAD_MODIFIED ) ? "OK" : "FAILURE"), m_iter );
if( st == SH_OK || st == SH_HEAD_MODIFIED ) if( st == SH_OK || st == SH_HEAD_MODIFIED )
{ {
@ -1241,8 +1240,8 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveMultiLines( const PNS_ITEMSET& aHeadSet
m_currentNode->RemoveByMarker( MK_HEAD ); m_currentNode->RemoveByMarker( MK_HEAD );
TRACE( 1, "Shove status : %s after %d iterations", wxLogTrace( "PNS", "Shove status : %s after %d iterations",
( st == SH_OK ? "OK" : "FAILURE") % m_iter ); ( st == SH_OK ? "OK" : "FAILURE"), m_iter );
if( st == SH_OK ) if( st == SH_OK )
{ {

View File

@ -55,8 +55,6 @@ using namespace std::placeholders;
#include "pns_tune_status_popup.h" #include "pns_tune_status_popup.h"
#include "pns_topology.h" #include "pns_topology.h"
#include "trace.h"
using namespace KIGFX; using namespace KIGFX;
TOOL_ACTION PNS_TOOL_BASE::ACT_RouterOptions( "pcbnew.InteractiveRouter.RouterOptions", TOOL_ACTION PNS_TOOL_BASE::ACT_RouterOptions( "pcbnew.InteractiveRouter.RouterOptions",
@ -185,7 +183,9 @@ PNS_ITEM* PNS_TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int a
rv = NULL; rv = NULL;
if( rv ) if( rv )
TRACE( 0, "%s, layer : %d, tl: %d", rv->KindStr().c_str() % rv->Layers().Start() % tl ); {
wxLogTrace( "PNS", "%s, layer : %d, tl: %d", rv->KindStr().c_str(), rv->Layers().Start(), tl );
}
return rv; return rv;
} }
@ -307,7 +307,9 @@ void PNS_TOOL_BASE::updateEndItem( TOOL_EVENT& aEvent )
} }
if( m_endItem ) if( m_endItem )
TRACE( 0, "%s, layer : %d", m_endItem->KindStr().c_str() % m_endItem->Layers().Start() ); {
wxLogTrace( "PNS", "%s, layer : %d", m_endItem->KindStr().c_str(), m_endItem->Layers().Start() );
}
} }

View File

@ -54,7 +54,6 @@ using namespace std::placeholders;
#include "router_tool.h" #include "router_tool.h"
#include "pns_segment.h" #include "pns_segment.h"
#include "pns_router.h" #include "pns_router.h"
#include "trace.h"
using namespace KIGFX; using namespace KIGFX;
using boost::optional; using boost::optional;
@ -296,7 +295,7 @@ void ROUTER_TOOL::handleCommonEvents( const TOOL_EVENT& aEvent )
switch( aEvent.KeyCode() ) switch( aEvent.KeyCode() )
{ {
case '0': case '0':
TRACEn( 2, "saving drag/route log...\n" ); wxLogTrace( "PNS", "saving drag/route log...\n" );
m_router->DumpLog(); m_router->DumpLog();
break; break;
} }

View File

@ -1,46 +0,0 @@
/*
* KiRouter - a push-and-(sometimes-)shove PCB router
*
* Copyright (C) 2013 CERN
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TRACE_H
#define __TRACE_H
#include <string>
#include <iostream>
#include <boost/format.hpp>
static inline void _trace_print( const char* aFuncName, int aLevel, const std::string& aMsg )
{
#ifdef DEBUG
std::cerr << "trace[" << aLevel << "]: " << aFuncName << ": " << aMsg << std::endl;
#endif
}
#ifdef PNS_DEBUG
#define TRACE( level, fmt, ... ) \
_trace_print( __FUNCTION__, level, ( boost::format( fmt ) % __VA_ARGS__ ).str() );
#define TRACEn( level, msg ) \
_trace_print( __FUNCTION__, level, std::string( msg ) );
#else
#define TRACE( ... )
#define TRACEn( ... )
#endif
#endif