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()); }
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()); }