MEONMedical / Log4Qt

Log4Qt - Logging for the Qt cross-platform application framework
Apache License 2.0
580 stars 234 forks source link

log4Qt cannot setEncoding #49

Closed kasonyin closed 3 years ago

kasonyin commented 3 years ago

log4Qt version:1.5.0 writerappender.cpp

void WriterAppender::setEncoding(QTextCodec *encoding)
{
    QMutexLocker locker(&mObjectGuard);

    if (mEncoding == encoding)
        return;

    mEncoding = encoding;
    if (mWriter != nullptr)
    {
        if (mEncoding != nullptr)
            mWriter->setCodec(mEncoding);

        // Just annotate out this sentence
        mWriter->setCodec(QTextCodec::codecForLocale());
    }
}