This is not a future as it was just put into cvs. However, what it provides is a Common C++ interface to the Unix syslog facility. The intended usage of slog is meant to be very similar to "clog"; a default
slog object is pre-initialized, and you stream character data to it.
The new "slog" allows one to specify logging levels and other properties through the () operators. Hence, once can do:
slog("mydaemon", SLOG_DAEMON, SLOG_EMERGENCY) << I just died << endl;
The intent is to be as common-place and as convenient to use as the stderr based clog facility found in C++, and this is especially useful for C++ daemons.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What about moding this so one can create log files on other platforms such as Win32. Mailslots perhaps? I've grown to use syslog on a FreeBSD system quite heavily, and would love to be able to do error reporting the right way through slog across platforms...
AZ
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is not a future as it was just put into cvs. However, what it provides is a Common C++ interface to the Unix syslog facility. The intended usage of slog is meant to be very similar to "clog"; a default
slog object is pre-initialized, and you stream character data to it.
The new "slog" allows one to specify logging levels and other properties through the () operators. Hence, once can do:
slog("mydaemon", SLOG_DAEMON, SLOG_EMERGENCY) << I just died << endl;
or things like:
slog("mydaemon", SLOG_DAEMON);
slog(SLOG_INFO) << "daemon initalized" << endl;
The intent is to be as common-place and as convenient to use as the stderr based clog facility found in C++, and this is especially useful for C++ daemons.
What about moding this so one can create log files on other platforms such as Win32. Mailslots perhaps? I've grown to use syslog on a FreeBSD system quite heavily, and would love to be able to do error reporting the right way through slog across platforms...
AZ
On most UNIX platforms, slog uses the "syslog" facility directly. On win32
I am not sure what would be best to do, and there is no "slog" there yet.