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

StderrLog Class Reference

Log class writing to standard error. 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 &)
void error (Database &, Query &, const std::string &)

Detailed Description

Log class writing to standard error.

Definition at line 42 of file StderrLog.h.


Member Function Documentation

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

Implements IError.

Definition at line 53 of file StderrLog.cpp.

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

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

Implements IError.

Definition at line 64 of file StderrLog.cpp.

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

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


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