Reorganized some debug code
This commit is contained in:
parent
dbac09405f
commit
2ae2dc86c6
1 changed files with 20 additions and 17 deletions
|
|
@ -235,19 +235,19 @@ commodity_t::varied_history_t::find_price(const commodity_t& source,
|
||||||
DEBUG_INDENT("commodity.prices.find", indent);
|
DEBUG_INDENT("commodity.prices.find", indent);
|
||||||
DEBUG("commodity.prices.find", "varied_find_price for: " << source);
|
DEBUG("commodity.prices.find", "varied_find_price for: " << source);
|
||||||
|
|
||||||
DEBUG_INDENT("commodity.prices.find", indent);
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
if (commodity)
|
if (commodity)
|
||||||
DEBUG("commodity.prices.find", "looking for: commodity '" << *commodity << "'");
|
DEBUG("commodity.prices.find", "looking for: commodity '" << *commodity << "'");
|
||||||
else
|
else
|
||||||
DEBUG("commodity.prices.find", "looking for: any commodity");
|
DEBUG("commodity.prices.find", "looking for: any commodity");
|
||||||
|
|
||||||
if (moment) {
|
if (moment) {
|
||||||
DEBUG_INDENT("commodity.prices.find", indent);
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
DEBUG("commodity.prices.find", "time index: " << *moment);
|
DEBUG("commodity.prices.find", "time index: " << *moment);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldest) {
|
if (oldest) {
|
||||||
DEBUG_INDENT("commodity.prices.find", indent);
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
DEBUG("commodity.prices.find", "only consider prices younger than: " << *oldest);
|
DEBUG("commodity.prices.find", "only consider prices younger than: " << *oldest);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -308,6 +308,7 @@ commodity_t::varied_history_t::find_price(const commodity_t& source,
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(! commodity || point->price.commodity() == *commodity);
|
assert(! commodity || point->price.commodity() == *commodity);
|
||||||
|
|
||||||
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
DEBUG("commodity.prices.find",
|
DEBUG("commodity.prices.find",
|
||||||
"saw a price there: " << point->price << " from " << point->when);
|
"saw a price there: " << point->price << " from " << point->when);
|
||||||
|
|
@ -316,6 +317,10 @@ commodity_t::varied_history_t::find_price(const commodity_t& source,
|
||||||
limit = point->when;
|
limit = point->when;
|
||||||
best = *point;
|
best = *point;
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
|
DEBUG("commodity.prices.find",
|
||||||
|
"search limit adjusted to " << *limit);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
|
|
@ -324,9 +329,7 @@ commodity_t::varied_history_t::find_price(const commodity_t& source,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
DEBUG_INDENT("commodity.prices.find", indent);
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
DEBUG("commodity.prices.find",
|
|
||||||
" found price " << best.price << " from " << best.when);
|
|
||||||
DEBUG("commodity.download",
|
DEBUG("commodity.download",
|
||||||
"found price " << best.price << " from " << best.when);
|
"found price " << best.price << " from " << best.when);
|
||||||
return best;
|
return best;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue