The log file is opened in opts$dir.output/opts$LOGFILE, but only if opts$fileMode==TRUE.
tdmGraAndLogInitialize(opts)with opts$GD.DEVICE one out of
[ "pdf" | "png" | "win" | "rstudio" | "non" ],
see tdmGraphicInit
gdObj, an object of class TDMgdev. Pass this object on when calling tdmGraAndLogFinalize(opts,gdObj)
(if not, a warning is issued before the sink-closing-error occurs)