[util.cpp#L216](https://github.com/bitcoin/bitcoin/blob/master/src/util.cpp#L216) 
if `fopen `failed, a null file pointer could be passed to `FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);`
{
    string strStamped;
    if (!fLogTimestamps)
        return str;
    if (*fStartedNewLine) {
        int64_t nTimeMicros = GetLogTimeMicros();
        strStamped = DateTimeStrFormat("%Y-%m-%d %H:%M:%S", nTimeMicros/1000000);
        if (fLogTimeMicros)
            strStamped += strprintf(".%06d", nTimeMicros%1000000);
        strStamped += ' ' + str;
    } else
        strStamped = str;
    if (!str.empty() && str[str.size()-1] == '\n')
        *fStartedNewLine = true;
    else
        *fStartedNewLine = false;
    return strStamped;
}
int LogPrintStr(const std::string &str)
{
    int ret = 0; 
    static std::atomic_bool fStartedNewLine(true);
    string strTimestamped = LogTimestampStr(str, &fStartedNewLine);
    if (fPrintToConsole)
    {
        
        ret = fwrite(strTimestamped.data(), 1, strTimestamped.size(), stdout);
        fflush(stdout);
    }
    else if (fPrintToDebugLog)