vslogf()

Send a message to the system logger (varargs)

Synopsis:

#include <stdio.h>
#include <sys/slog.h>

int vslogf( int opcode,
            int severity, 
            const char * fmt,
            va_list arg );

Arguments:

opcode
A combination of a major and minor code. Create the opcode using the _SLOG_SETCODE(major, minor) macro that's defined in <sys/slog.h>.

The major and minor codes are defined in <sys/slogcodes.h>.

severity
The severity of the log message; see "Severity levels," in the documentation for slogf().
fmt
A standard printf() string.
arg
A variable-argument list of the additional arguments, which you must have initialized with the va_start() macro.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

The slog*() functions send log messages to the system logger, slogger. To send formatted messages, use vslogf(). If you have programs that scan log files for specified codes, you can use slogb() or slogi() to send a block of structures or int's, respectively.

This function is a "varargs" version of slogf().

(QNX Neutrino 6.6) You can't redirect slogger output to slogger2 in general, but if a program uses the slogger APIs, you can preload the libslog2shim.so library when you start the program, in order to redirect its logs:

LD_PRELOAD=libslog2shim.so my_program

Classification:

QNX Neutrino

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes