From 35241984e051abc77f2dcf5dd3ad79e5bc710184 Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Thu, 28 Dec 2017 18:14:26 +0800 Subject: [PATCH] Fix MySQL Wrapper Watcher --- MySQLWrapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MySQLWrapper.cpp b/MySQLWrapper.cpp index 912e8c8..b8ec622 100644 --- a/MySQLWrapper.cpp +++ b/MySQLWrapper.cpp @@ -90,11 +90,11 @@ int MySQLConn::connect(const std::string& host, const std::string& user, const s } } -FILE* fp=fopen("sql_log.txt","w"); +FILE* fp=[](){FILE* s=fopen("sql_log.txt","a");fprintf(s,"%p=============\n",s);return s;}(); int MySQLConn::exec(const std::string& SQLCommand, const std::function& func) { - fprintf(fp,"%s\n",SQLCommand.c_str()); + fprintf(fp,"%p: %s\n",this,SQLCommand.c_str()); fflush(fp); if(mysql_real_query(&(pimpl->m),SQLCommand.c_str(),SQLCommand.size())!=0)