STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
218
NAME
strlog () – Submit messages for logging to streams log driver.
SYNOPSIS
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/strlog.h>
int strlog(short mid, short sid, char level, ushort_t flags, char *fmt, ... /* args */);
PARAMETERS
mid
STREAMS module id for the module/driver submitting the message for logging.
sid
Refers to the sub-ID number of a minor device of the driver associated with the STREAMS
module or driver identified by mid.
level
Specifies a level for selective screening of lower-level event messages from a tracer.
flags
Contains several flags that can be set in various combinations. The flags are as follows:
SL_FATAL Provides a notification of a fatal error.
SL_NOTIFY Makes a request to mail a copy of a message to the system administrator.
SL_ERROR The message is for the error logger.
SL_TRACE The message is for the tracer.
SL_CONSOLE The message will be printed to the console.
The following are additional flags. The strlog interface does not use these flags:
SL_WARN The message is a warning.
SL_NOTE The message is a note.
fmt
printf style format string. This accepts the %x, %l, %o, %u, %d, %c, and %s conversion
specifications.
args
Are numeric or character arguments for the format string. There is no maximum number of
arguments that can be specified.
DESCRIPTION
strlog() submits messages containing specified information to the streams log driver, strlog (7). The
messages can be retrieved with the getmsg() system call. The flags argument specifies the type of the
message and where it is to be sent. strace (1M) receives messages from the log driver and sends them to the
standard output. strerr (1M) receives error messages from the log driver and appends them to a file called
/var/adm/streams/error.mm-dd, where mm-dd identifies the date of the error message.
RETURN VALUES
None