<p>Regarding your other suggestion of moving the log objects to CLI: all that is required to ensure that the singleton CLI object is deleted while the Log object are alive. Moving cliDeleter object to Log.cpp should do that. <br>
Since ProgramDoc constructor uses CLI singleton and we cannot guarantee that ProgramDoc will be constructed only after the Log objects are created because they are in different files, I am now fixated unless I see code to the contrary, on the the idea that all we can do is ensure  cliDeleter is constructed after Log objects and that no static construction of CLI uses Log objects.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/524#issuecomment-189068548">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFCM2-7f5RZmElLMW-J49TntSR_5aks5pn6AWgaJpZM4HiVT8.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/524#issuecomment-189068548"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>