class logbuf

A streambuffer, logging via syslog More...

Definition#include <log.h>
Inheritsstreambuf
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

A streambuffer, logging via syslog

logbuf can be used, if you want to use syslog for logging but don't want to change all your nice C++-style output statements in your code.

Here is an example showing the usage of logbuf:


	openlog("myDaemon", LOG_CONS|LOG_PID, LOG_DAEMON);
	logbuf ebuf(LOG_ERR);
	ostream lerr(&ebuf);

	... some code ...

	lerr << "Whoops, got an error" << endl;

 logbuf (int level)

Constructs a new instance.

Parameters:

int  overflow (int c = EOF)

Called by the associated ostream to write a character. Stores the character in a buffer and calls syslog(level, buffer) whenever a LF is seen.


Generated by: felfert@floh.fe.think on Mon Jul 23 21:42:43 2001, using kdoc 2.0a40.