Forums  +  C++ and Sockets  +  C++ and SQL: MySQL, sqlite, ODBC  +  Miscellaneous Projects
Logo
~Database~
~ C++ ~
~Contact~

StderrLog Class Reference

Log class writing to stderr. More...

#include <StderrLog.h>

Inheritance diagram for StderrLog:

Inheritance graph
Collaboration diagram for StderrLog:

Collaboration graph
List of all members.

Public Member Functions

void error (Database &, const std::string &)
 StderrLog.cpp.
void error (Database &, Query &, const std::string &)

Detailed Description

Log class writing to stderr.

Definition at line 41 of file StderrLog.h.


Member Function Documentation

void StderrLog::error ( Database db,
const std::string &  str 
) [virtual]

StderrLog.cpp.

Published / author: 2004-08-18 / grymse@alhem.net

Implements IError.

Definition at line 58 of file StderrLog.cpp.

00059 {
00060         time_t t = time(NULL);
00061         struct tm *tp = localtime(&t);
00062         fprintf(stderr,"%d-%02d-%02d %02d:%02d:%02d :: Database: %s\n",
00063                 tp -> tm_year + 1900,tp -> tm_mon + 1,tp -> tm_mday,
00064                 tp -> tm_hour,tp -> tm_min, tp -> tm_sec,
00065                 str.c_str());
00066 }

void StderrLog::error ( Database ,
Query ,
const std::string &   
) [virtual]

Implements IError.

Definition at line 69 of file StderrLog.cpp.

References Query::GetErrno(), Query::GetError(), and Query::GetLastQuery().

00070 {
00071         time_t t = time(NULL);
00072         struct tm *tp = localtime(&t);
00073         fprintf(stderr,"%d-%02d-%02d %02d:%02d:%02d :: Query: %s: %s(%d)\n",
00074                 tp -> tm_year + 1900,tp -> tm_mon + 1,tp -> tm_mday,
00075                 tp -> tm_hour,tp -> tm_min, tp -> tm_sec,
00076                 str.c_str(),q.GetError().c_str(),q.GetErrno());
00077         fprintf(stderr," (QUERY: \"%s\")\n",q.GetLastQuery().c_str());
00078 }


The documentation for this class was generated from the following files:
Page, code, and content Copyright (C) 2006 by Anders Hedström