Small C++ tip: it is way better to formulate this test like this:

```
if (!logTime.good())
{
 // print error
 return;
}
```

It will avoid having to put all the implementation in a scope.

Also `is_open` and `good` semantics are a bit different. Please consult STO documentation for more information: http://www.cplusplus.com/reference/ios/ios/good/