Skip to content

Commit 2984a42

Browse files
damienbarkerfarahkhashman
authored andcommitted
Merge branch 'feature/QPR-12983' into 'master'
QPR-12983 reduce log level Closes QPR-12983 See merge request qs/oreplus!3014
1 parent c0965b4 commit 2984a42

4 files changed

Lines changed: 35 additions & 35 deletions

File tree

OREAnalytics/orea/scenario/scenariosimmarket.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,12 +1352,12 @@ ScenarioSimMarket::ScenarioSimMarket(
13521352
for (const auto& name : param.second.second) {
13531353
bool simDataWritten = false;
13541354
try {
1355-
LOG("building " << name << " cds vols..");
1355+
DLOG("building " << name << " cds vols..");
13561356
Handle<QuantExt::CreditVolCurve> wrapper = initMarket->cdsVol(name, configuration);
13571357
Handle<QuantExt::CreditVolCurve> cvh;
13581358
bool stickyStrike = parameters_->cdsVolSmileDynamics(name) == "StickyStrike";
13591359
if (param.second.first) {
1360-
LOG("Simulating CDS Vols for " << name);
1360+
DLOG("Simulating CDS Vols for " << name);
13611361
vector<Handle<Quote>> quotes;
13621362
vector<Volatility> vols;
13631363
vector<Time> times;
@@ -1426,7 +1426,7 @@ ScenarioSimMarket::ScenarioSimMarket(
14261426
}
14271427
} else {
14281428
string decayModeString = parameters->cdsVolDecayMode();
1429-
LOG("Deterministic CDS Vols with decay mode " << decayModeString << " for " << name);
1429+
DLOG("Deterministic CDS Vols with decay mode " << decayModeString << " for " << name);
14301430
ReactionToTimeDecay decayMode = parseDecayMode(decayModeString);
14311431

14321432
// TODO support strike and term dependence, hardcoded term 5y
@@ -1477,7 +1477,7 @@ ScenarioSimMarket::ScenarioSimMarket(
14771477
bool stickyStrike = parameters_->fxVolSmileDynamics(name) == "StickyStrike";
14781478

14791479
if (param.second.first) {
1480-
LOG("Simulating FX Vols for " << name);
1480+
DLOG("Simulating FX Vols for " << name);
14811481
auto& expiries = parameters->fxVolExpiries(name);
14821482
Size m = expiries.size();
14831483
Calendar cal = wrapper->calendar();
@@ -1683,14 +1683,14 @@ ScenarioSimMarket::ScenarioSimMarket(
16831683
Handle<BlackVolTermStructure>(wrapper), times, quotes[0],
16841684
!parameters->simulateFxVolATMOnly());
16851685
} else {
1686-
LOG("ATM FX Vols (BlackVarianceCurve3) for " << name);
1686+
DLOG("ATM FX Vols (BlackVarianceCurve3) for " << name);
16871687
QuantLib::ext::shared_ptr<BlackVolTermStructure> atmCurve;
16881688
atmCurve = QuantLib::ext::make_shared<BlackVarianceCurve3>(
16891689
0, NullCalendar(), wrapper->businessDayConvention(), dc, times, quotes[0], false);
16901690
// if we have a surface but are only simulating atm vols we wrap the atm curve and
16911691
// the full t0 surface
16921692
if (parameters->simulateFxVolATMOnly()) {
1693-
LOG("Simulating FX Vols (FXVolatilityConstantSpread) for " << name);
1693+
DLOG("Simulating FX Vols (FXVolatilityConstantSpread) for " << name);
16941694
fxVolCurve = QuantLib::ext::make_shared<BlackVolatilityConstantSpread>(
16951695
Handle<BlackVolTermStructure>(atmCurve), wrapper);
16961696
} else {
@@ -1702,7 +1702,7 @@ ScenarioSimMarket::ScenarioSimMarket(
17021702

17031703
} else {
17041704
string decayModeString = parameters->fxVolDecayMode();
1705-
LOG("Deterministic FX Vols with decay mode " << decayModeString << " for " << name);
1705+
DLOG("Deterministic FX Vols with decay mode " << decayModeString << " for " << name);
17061706
ReactionToTimeDecay decayMode = parseDecayMode(decayModeString);
17071707

17081708
// currently only curves (i.e. strike independent) FX volatility structures are
@@ -1803,7 +1803,7 @@ ScenarioSimMarket::ScenarioSimMarket(
18031803
}
18041804
writeSimData(simDataTmp, absoluteSimDataTmp, param.first, name, {strikes, times});
18051805
simDataWritten = true;
1806-
LOG("Simulating EQ Vols (BlackVarianceSurfaceMoneyness) for " << name);
1806+
DLOG("Simulating EQ Vols (BlackVarianceSurfaceMoneyness) for " << name);
18071807

18081808
if (useSpreadedTermStructures_) {
18091809
eqVolCurve = QuantLib::ext::make_shared<SpreadedBlackVolatilitySurfaceMoneynessForward>(
@@ -1921,15 +1921,15 @@ ScenarioSimMarket::ScenarioSimMarket(
19211921
Handle<BlackVolTermStructure>(wrapper), times, quotes[0],
19221922
!parameters->simulateEquityVolATMOnly());
19231923
} else {
1924-
LOG("ATM EQ Vols (BlackVarianceCurve3) for " << name);
1924+
DLOG("ATM EQ Vols (BlackVarianceCurve3) for " << name);
19251925
QuantLib::ext::shared_ptr<BlackVolTermStructure> atmCurve;
19261926
atmCurve = QuantLib::ext::make_shared<BlackVarianceCurve3>(0, NullCalendar(),
19271927
wrapper->businessDayConvention(),
19281928
dc, times, quotes[0], false);
19291929
// if we have a surface but are only simulating atm vols we wrap the atm curve and
19301930
// the full t0 surface
19311931
if (parameters->simulateEquityVolATMOnly()) {
1932-
LOG("Simulating EQ Vols (EquityVolatilityConstantSpread) for " << name);
1932+
DLOG("Simulating EQ Vols (EquityVolatilityConstantSpread) for " << name);
19331933
eqVolCurve = QuantLib::ext::make_shared<BlackVolatilityConstantSpread>(
19341934
Handle<BlackVolTermStructure>(atmCurve), wrapper);
19351935
} else {
@@ -2103,7 +2103,7 @@ ScenarioSimMarket::ScenarioSimMarket(
21032103
for (const auto& name : param.second.second) {
21042104
bool simDataWritten = false;
21052105
try {
2106-
LOG("building " << name << " zero inflation curve");
2106+
DLOG("building " << name << " zero inflation curve");
21072107

21082108
Handle<ZeroInflationIndex> inflationIndex = initMarket->zeroInflationIndex(name, configuration);
21092109
Handle<ZeroInflationTermStructure> inflationTs = inflationIndex->zeroInflationTermStructure();
@@ -2175,7 +2175,7 @@ ScenarioSimMarket::ScenarioSimMarket(
21752175
Handle<ZeroInflationIndex> zh(i);
21762176
zeroInflationIndices_.insert(make_pair(make_pair(Market::defaultConfiguration, name), zh));
21772177

2178-
LOG("building " << name << " zero inflation curve done");
2178+
DLOG("building " << name << " zero inflation curve done");
21792179
} catch (const std::exception& e) {
21802180
processException(e, name, param.first, simDataWritten);
21812181
gotException = true;
@@ -2187,7 +2187,7 @@ ScenarioSimMarket::ScenarioSimMarket(
21872187
for (const auto& name : param.second.second) {
21882188
bool simDataWritten = false;
21892189
try {
2190-
LOG("building " << name << " zero inflation cap/floor volatility curve...");
2190+
DLOG("building " << name << " zero inflation cap/floor volatility curve...");
21912191
Handle<QuantLib::CPIVolatilitySurface> wrapper =
21922192
initMarket->cpiInflationCapFloorVolatilitySurface(name, configuration);
21932193
Handle<ZeroInflationIndex> zeroInflationIndex =
@@ -2199,7 +2199,7 @@ ScenarioSimMarket::ScenarioSimMarket(
21992199

22002200
// Check if the risk factor is simulated before adding it
22012201
if (param.second.first) {
2202-
LOG("Simulating zero inflation cap/floor vols for index name " << name);
2202+
DLOG("Simulating zero inflation cap/floor vols for index name " << name);
22032203

22042204
DayCounter dc = wrapper->dayCounter();
22052205
vector<Period> optionTenors = parameters->zeroInflationCapFloorVolExpiries(name);
@@ -2366,16 +2366,16 @@ ScenarioSimMarket::ScenarioSimMarket(
23662366
for (const auto& name : param.second.second) {
23672367
bool simDataWritten = false;
23682368
try {
2369-
LOG("building " << name << " yoy inflation cap/floor volatility curve...");
2369+
DLOG("building " << name << " yoy inflation cap/floor volatility curve...");
23702370
Handle<QuantExt::YoYOptionletVolatilitySurface> wrapper =
23712371
initMarket->yoyCapFloorVol(name, configuration);
2372-
LOG("Initial market "
2372+
DLOG("Initial market "
23732373
<< name << " yoy inflation cap/floor volatility type = " << wrapper->volatilityType());
23742374
Handle<QuantExt::YoYOptionletVolatilitySurface> hYoYCapletVol;
23752375

23762376
// Check if the risk factor is simulated before adding it
23772377
if (param.second.first) {
2378-
LOG("Simulating yoy inflation optionlet vols for index name " << name);
2378+
DLOG("Simulating yoy inflation optionlet vols for index name " << name);
23792379
vector<Period> optionTenors = parameters->yoyInflationCapFloorVolExpiries(name);
23802380
vector<Date> optionDates(optionTenors.size());
23812381
vector<Real> strikes = parameters->yoyInflationCapFloorVolStrikes(name);
@@ -2442,7 +2442,7 @@ ScenarioSimMarket::ScenarioSimMarket(
24422442
yoyCapFloorVolSurfaces_.emplace(std::piecewise_construct,
24432443
std::forward_as_tuple(Market::defaultConfiguration, name),
24442444
std::forward_as_tuple(hYoYCapletVol));
2445-
LOG("Simulation market yoy inflation cap/floor volatility type = "
2445+
DLOG("Simulation market yoy inflation cap/floor volatility type = "
24462446
<< hYoYCapletVol->volatilityType());
24472447
} catch (const std::exception& e) {
24482448
processException(e, name, param.first, simDataWritten);
@@ -2477,7 +2477,7 @@ ScenarioSimMarket::ScenarioSimMarket(
24772477

24782478
bool simDataWritten = false;
24792479
try {
2480-
LOG("building commodity curve for " << name);
2480+
DLOG("building commodity curve for " << name);
24812481

24822482
// Time zero initial market commodity curve
24832483
Handle<PriceTermStructure> initialCommodityCurve =
@@ -2590,7 +2590,7 @@ ScenarioSimMarket::ScenarioSimMarket(
25902590
for (const auto& name : param.second.second) {
25912591
bool simDataWritten = false;
25922592
try {
2593-
LOG("building commodity volatility for " << name);
2593+
DLOG("building commodity volatility for " << name);
25942594

25952595
// Get initial base volatility structure
25962596
Handle<BlackVolTermStructure> baseVol = initMarket->commodityVolatility(name, configuration);
@@ -2766,7 +2766,7 @@ ScenarioSimMarket::ScenarioSimMarket(
27662766
for (const auto& name : param.second.second) {
27672767
bool simDataWritten = false;
27682768
try {
2769-
LOG("Adding correlations for " << name << " from configuration " << configuration);
2769+
DLOG("Adding correlations for " << name << " from configuration " << configuration);
27702770

27712771
vector<string> tokens = getCorrelationTokens(name);
27722772
QL_REQUIRE(tokens.size() == 2, "not a valid correlation pair: " << name);
@@ -2899,7 +2899,7 @@ ScenarioSimMarket::ScenarioSimMarket(
28992899
}
29002900

29012901
if (!param.second.second.empty()) {
2902-
LOG("built " << std::left << std::setw(25) << param.first << std::right << std::setw(10)
2902+
DLOG("built " << std::left << std::setw(25) << param.first << std::right << std::setw(10)
29032903
<< param.second.second.size() << std::setprecision(3) << std::setw(15)
29042904
<< static_cast<double>(timer.elapsed().wall) / 1E6 << " ms");
29052905
}

OREData/ored/marketdata/genericyieldvolcurve.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ GenericYieldVolCurve::GenericYieldVolCurve(
187187
}
188188
}
189189

190-
LOG("GenericYieldVolCurve: read " << quotesRead << " vols and " << shiftQuotesRead << " shift quotes");
190+
DLOG("GenericYieldVolCurve: read " << quotesRead << " vols and " << shiftQuotesRead << " shift quotes");
191191

192192
// check we have found all requires values
193193
bool haveAllAtmValues = true;
@@ -284,10 +284,10 @@ GenericYieldVolCurve::GenericYieldVolCurve(
284284

285285
if (config->dimension() == GenericYieldVolatilityCurveConfig::Dimension::ATM) {
286286
// Nothing more to do
287-
LOG("Returning ATM surface for config " << config->curveID());
287+
DLOG("Returning ATM surface for config " << config->curveID());
288288
vol_ = atm;
289289
} else {
290-
LOG("Building Cube for config " << config->curveID());
290+
DLOG("Building Cube for config " << config->curveID());
291291
vector<Period> smileOptionTenors =
292292
parseVectorOfValues<Period>(config->smileOptionTenors(), &parsePeriod);
293293
vector<Period> smileUnderlyingTenors =
@@ -315,9 +315,9 @@ GenericYieldVolCurve::GenericYieldVolCurve(
315315
for (auto& j : i)
316316
j = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.0));
317317

318-
LOG("vol cube smile option tenors " << smileOptionTenors.size());
319-
LOG("vol cube smile swap tenors " << smileUnderlyingTenors.size());
320-
LOG("vol cube strike spreads " << spreads.size());
318+
DLOG("vol cube smile option tenors " << smileOptionTenors.size());
319+
DLOG("vol cube smile swap tenors " << smileUnderlyingTenors.size());
320+
DLOG("vol cube strike spreads " << spreads.size());
321321

322322
Size spreadQuotesRead = 0;
323323
for (auto& p : config->quotes()) {
@@ -393,7 +393,7 @@ GenericYieldVolCurve::GenericYieldVolCurve(
393393
vol - atm->volatility(smileOptionTenors[i], smileUnderlyingTenors[j], 0.0)));
394394
}
395395
}
396-
LOG("Read " << spreadQuotesRead << " quotes for VolCube.");
396+
DLOG("Read " << spreadQuotesRead << " quotes for VolCube.");
397397

398398
// post processing: extrapolate leftmost non-zero value flat to the left and overwrite
399399
// zero values

OREData/ored/marketdata/todaysmarket.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,16 @@ void TodaysMarket::initialise(const Date& asof) {
229229

230230
// output stats on initialisation phase
231231

232-
LOG("TodaysMarket build stats:");
232+
DLOG("TodaysMarket build stats:");
233233
boost::timer::nanosecond_type sum = 0;
234234
for (auto const& t : timings) {
235235
std::size_t c = counts[t.first].count == 0 ? 1 : counts[t.first].count;
236236
double timing = static_cast<double>(t.second) / 1.0E6;
237-
LOG(std::left << std::setw(34) << t.first << ": " << std::right << std::setprecision(3) << std::setw(15)
237+
DLOG(std::left << std::setw(34) << t.first << ": " << std::right << std::setprecision(3) << std::setw(15)
238238
<< timing << " ms" << std::setw(10) << c << std::setw(15) << timing / c << " ms");
239239
sum += t.second;
240240
}
241-
LOG("Total build time : " << std::setw(15) << static_cast<double>(sum) / 1.0E6 << " ms");
241+
DLOG("Total build time : " << std::setw(15) << static_cast<double>(sum) / 1.0E6 << " ms");
242242

243243
// output errors from initialisation phase
244244

OREData/ored/portfolio/vanillaoption.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,15 @@ void VanillaOptionTrade::build(const QuantLib::ext::shared_ptr<ore::data::Engine
260260
if (forwardDate_ == QuantLib::Date()) {
261261
// If not European or not cash settled, build QuantLib::VanillaOption.
262262
if (sameCcy) {
263-
LOG("Build VanillaOption for trade " << id());
263+
DLOG("Build VanillaOption for trade " << id());
264264
vanilla = QuantLib::ext::make_shared<QuantLib::VanillaOption>(payoff, exercise);
265265
} else {
266-
LOG("Build QuantoVanillaOption for trade " << id());
266+
DLOG("Build QuantoVanillaOption for trade " << id());
267267
vanilla = QuantLib::ext::make_shared<QuantLib::QuantoVanillaOption>(payoff, exercise);
268268
tradeTypeBuilder = tradeType_ + "American";
269269
}
270270
} else {
271-
LOG("Built VanillaForwardOption for trade " << id());
271+
DLOG("Built VanillaForwardOption for trade " << id());
272272
vanilla = QuantLib::ext::make_shared<QuantExt::VanillaForwardOption>(payoff, exercise, forwardDate_, paymentDate_);
273273
if (assetClassUnderlying_ == AssetClass::COM || assetClassUnderlying_ == AssetClass::FX) {
274274
if (exerciseType == QuantLib::Exercise::Type::European) {

0 commit comments

Comments
 (0)