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

SysLog Class Reference

Log class writing to syslog. More...

#include <SysLog.h>

Inheritance diagram for SysLog:

Inheritance graph
Collaboration diagram for SysLog:

Collaboration graph
List of all members.

Public Member Functions

 SysLog (const std::string &="database", int=LOG_PID, int=LOG_USER)
 SysLog.cpp.
virtual ~SysLog ()
void error (Database &, const std::string &)
void error (Database &, Query &, const std::string &)

Detailed Description

Log class writing to syslog.

Definition at line 44 of file SysLog.h.


Constructor & Destructor Documentation

SysLog::SysLog ( const std::string &  appname = "database",
int  option = LOG_PID,
int  facility = LOG_USER 
)

SysLog.cpp.

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

Definition at line 48 of file SysLog.cpp.

00049 {
00050 static  char blah[100];
00051         strcpy(blah, appname.c_str());
00052         openlog(blah, option, facility);
00053 }

SysLog::~SysLog (  )  [virtual]

Definition at line 56 of file SysLog.cpp.

00057 {
00058         closelog();
00059 }


Member Function Documentation

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

Implements IError.

Definition at line 62 of file SysLog.cpp.

00063 {
00064         syslog(LOG_ERR, "%s", str.c_str() );
00065 }

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

Implements IError.

Definition at line 68 of file SysLog.cpp.

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

00069 {
00070         syslog(LOG_ERR, "%s: %s(%d)", str.c_str(),q.GetError().c_str(),q.GetErrno() );
00071         syslog(LOG_ERR, "QUERY: \"%s\"", q.GetLastQuery().c_str());
00072 }


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