aboutsummaryrefslogtreecommitdiffstats
path: root/R/calibrate_tranches_BC.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/calibrate_tranches_BC.R')
-rw-r--r--R/calibrate_tranches_BC.R8
1 files changed, 6 insertions, 2 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index e0174aac..be5b20f6 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -4,6 +4,10 @@ if(.Platform$OS.type == "unix"){
}else{
root.dir <- "//WDSENTINEL/share/CorpCDOs"
}
+library(logging)
+basicConfig()
+removeHandler('basic.stdout')
+addHandler(writeToFile, file=file.path(root.dir, "logs", "calibrate_tranches_BC.log"))
library(optparse)
option_list <- list(
make_option(c("-u", "--update"), action="store_true", default=FALSE,
@@ -64,7 +68,7 @@ for(i in seq_along(runs$name)){
for(j in seq_along(bus.dates)){
tradedate <- bus.dates[j]
- cat("calibrating", index.name, tenor, "for", as.character(tradedate), "\n", sep=" ")
+ loginfo(paste("calibrating", index.name, tenor, "for", as.character(tradedate)))
exportYC(tradedate)
index <- creditIndex(index.name, tenor)
index <- set.index.desc(index, tradedate)
@@ -97,6 +101,6 @@ for(i in seq_along(runs$name)){
cat(csvheaders(index), "\n", file=filename)
}
cat(tocsv(index), "\n", file=filename, append=TRUE)
- cat("done\n")
+ loginfo("done")
}
}