コード例 #1
0
void StderrLog::error(Database& db,Query& q,const std::string& str)
{
	time_t t = time(NULL);
	struct tm *tp = localtime(&t);
	fprintf(stderr,"%d-%02d-%02d %02d:%02d:%02d :: Query: %s: %s(%d)\n",
		tp -> tm_year + 1900,tp -> tm_mon + 1,tp -> tm_mday,
		tp -> tm_hour,tp -> tm_min, tp -> tm_sec,
		str.c_str(),q.GetError().c_str(),q.GetErrno());
	fprintf(stderr," (QUERY: \"%s\")\n",q.GetLastQuery().c_str());
}
コード例 #2
0
ファイル: StderrLog.cpp プロジェクト: M-griffin/Oblivion2-XRM
 void StderrLog::databaseError(Database& db, Query& q, const std::string& str)
 {
     UNUSED(db);
     time_t t = time(nullptr);
     struct tm tp;
     localtime_r(&t, &tp);
     fprintf(stderr,"%d-%02d-%02d %02d:%02d:%02d :: Query: %s: %s(%d)\n",
             tp.tm_year + 1900,tp.tm_mon + 1,tp.tm_mday,
             tp.tm_hour,tp.tm_min, tp.tm_sec,
             str.c_str(),q.GetError().c_str(),q.GetErrno());
     fprintf(stderr," (QUERY: \"%s\")\n",q.getLastQuery().c_str());
 }
コード例 #3
0
ファイル: SysLog.cpp プロジェクト: lindianyin/sgbj
void SysLog::error(Database& db,Query& q,const std::string& str)
{
	syslog(LOG_ERR, "%s: %s(%d)", str.c_str(),q.GetError().c_str(),q.GetErrno() );
	syslog(LOG_ERR, "QUERY: \"%s\"", q.GetLastQuery().c_str());
}