- changed status to resolved
setCodec missing after rotation
Issue #2
resolved
Hello, my application was crashing on each file rotation. (because I use a fake icudt51.dll to save space).
I solved the problem by re-setting the codec after rotation.
QsLogDestFile.cpp
if (mRotationStrategy->shouldRotate()) {
mOutputStream.setDevice(NULL);
mFile.close();
mRotationStrategy->rotate();
if (!mFile.open(QFile::WriteOnly | QFile::Text | mRotationStrategy->recommendedOpenModeFlag()))
std::cerr << "QsLog: could not reopen log file " << qPrintable(mFile.fileName());
mRotationStrategy->setInitialInfo(mFile);
mOutputStream.setDevice(&mFile);
//re-set the codec
mOutputStream.setCodec(QTextCodec::codecForName("UTF-8"));
}
Note: imported from Qt components repo.
Comments (1)
-
reporter - Log in to comment
Fixed in https://bitbucket.org/razvanpetru/qslog/commits/b7a94dc3cc6b8e7ea07a7a0c1c5521d54715f451?at=master