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 &)
void error (Database &, Query &, const std::string &)

Detailed Description

Log class writing to stderr.

Definition at line 32 of file StderrLog.h.


Member Function Documentation

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

Implements IError.

Definition at line 52 of file StderrLog.cpp.

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

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

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

Implements IError.

Definition at line 41 of file StderrLog.cpp.

00042 {
00043         time_t t = time(NULL);
00044         struct tm *tp = localtime(&t);
00045         fprintf(stderr,"%d-%02d-%02d %02d:%02d:%02d :: Database: %s\n",
00046                 tp -> tm_year + 1900,tp -> tm_mon + 1,tp -> tm_mday,
00047                 tp -> tm_hour,tp -> tm_min, tp -> tm_sec,
00048                 str.c_str());
00049 }


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