class logbuf

A streambuffer, logging via syslog More...

Definition#include <log.h>
Inheritsstreambuf (unknown) [public ]
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)

logbuf

Constructs a new instance.

Parameters:
levelThe log level for this instance. see syslog(3) for symbolic names to use.

int  overflow (int c = EOF)

overflow

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: john on dianna on Tue Nov 6 19:50:47 2001, using kdoc 2.0a53.