Commit 43373054 by 李定达

1.真正修复日志重印bug

parent 05e35493
...@@ -34,7 +34,7 @@ HostWidget::HostWidget(QWidget *parent) : ...@@ -34,7 +34,7 @@ HostWidget::HostWidget(QWidget *parent) :
connect(&_intertime, &QTimer::timeout, this, [this](){ connect(&_intertime, &QTimer::timeout, this, [this](){
if(!_need_exit) if(!_need_exit)
{ {
ui->label_pay_money->setText(QString::fromLocal8Bit("等待用户输入密码")); ui->label_pay_title->setText(QString::fromLocal8Bit("支付中/等待用户输入密码"));
ui->btn_pay_exitint->show(); ui->btn_pay_exitint->show();
} }
}); });
......
...@@ -40,6 +40,25 @@ BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpvReserved*/ ...@@ -40,6 +40,25 @@ BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpvReserved*/
qDebug() << "****************** currpath *******************88" << QDir::currentPath(); qDebug() << "****************** currpath *******************88" << QDir::currentPath();
ownApplication = QMfcApp::pluginInstance( hInstance ); ownApplication = QMfcApp::pluginInstance( hInstance );
char tmppath[MAX_PATH] = {0};
ToolS::GetProcPath(tmppath);
QString logDir = QString("%1/log").arg(QString(tmppath));
QDir().mkdir(logDir);
QsLogging::Logger& logger = QsLogging::Logger::instance();
logger.setLoggingLevel(QsLogging::TraceLevel);
QString str = QString(tmppath) + "\\log\\sbuxpay.txt";
/* 配置输出定向器 */
QsLogging::DestinationPtr fileDestination(QsLogging::DestinationFactory::MakeFileDestination(
str,
QsLogging::EnableLogRotation, QsLogging::MaxSizeBytes(1024*1024),
QsLogging::MaxOldLogCount(5)));
logger.addDestination(fileDestination);
QsLogging::DestinationPtr consleDest(QsLogging::DestinationFactory::MakeDebugOutputDestination());
logger.addDestination(consleDest);
} }
if ( dwReason == DLL_PROCESS_DETACH && ownApplication ) if ( dwReason == DLL_PROCESS_DETACH && ownApplication )
delete qApp; delete qApp;
...@@ -52,24 +71,24 @@ extern "C" __declspec(dllexport) void Start(const char *indata, char *outdata) ...@@ -52,24 +71,24 @@ extern "C" __declspec(dllexport) void Start(const char *indata, char *outdata)
HWND parent = GetDesktopWindow(); HWND parent = GetDesktopWindow();
QWinWidget win( parent ); QWinWidget win( parent );
char path[MAX_PATH] = {0}; // char path[MAX_PATH] = {0};
ToolS::GetProcPath(path); // ToolS::GetProcPath(path);
QString logDir = QString("%1/log").arg(QString(path)); // QString logDir = QString("%1/log").arg(QString(path));
QDir().mkdir(logDir); // QDir().mkdir(logDir);
QsLogging::Logger& logger = QsLogging::Logger::instance(); // QsLogging::Logger& logger = QsLogging::Logger::instance();
logger.setLoggingLevel(QsLogging::TraceLevel); // logger.setLoggingLevel(QsLogging::TraceLevel);
QString str = QString(path) + "\\log\\sbuxpay.txt"; // QString str = QString(path) + "\\log\\sbuxpay.txt";
/* 配置输出定向器 */ // /* 配置输出定向器 */
static QsLogging::DestinationPtr fileDestination(QsLogging::DestinationFactory::MakeFileDestination( // QsLogging::DestinationPtr fileDestination(QsLogging::DestinationFactory::MakeFileDestination(
str, // str,
QsLogging::EnableLogRotation, QsLogging::MaxSizeBytes(1024*1024), // QsLogging::EnableLogRotation, QsLogging::MaxSizeBytes(1024*1024),
QsLogging::MaxOldLogCount(5))); // QsLogging::MaxOldLogCount(5)));
logger.addDestination(fileDestination); // logger.addDestination(fileDestination);
static QsLogging::DestinationPtr consleDest(QsLogging::DestinationFactory::MakeDebugOutputDestination()); // QsLogging::DestinationPtr consleDest(QsLogging::DestinationFactory::MakeDebugOutputDestination());
logger.addDestination(consleDest); // logger.addDestination(consleDest);
// QByteArray rollback; // QByteArray rollback;
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2017-09-11T10:00:19. --> <!-- Written by QtCreator 3.5.1, 2017-09-11T14:19:48. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment