Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
setlogmask(3) OSS Library Calls Reference Manual
NAME
setlogmask - Sets the Event Management Service (EMS) event log mask
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossesrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zossedll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yossedll |
SYNOPSIS
#include <syslog.h>
int setlogmask(
int maskpri);
PARAMETERS
maskpri Contains a bit mask that indicates the events to be logged. Logging is enabled
for the levels indicated by the bits in the mask that are set and is disabled where
the bits are not set. The default value for maskpri is to log events of all priorities.
DESCRIPTION
Use the setlogmask( ) function to indicate which events are to be logged by calls to the syslog( )
function and which are to be discarded. The default action is to log events of all priorities. setlog-
mask() provides filtering of events before they are logged, so that the filtering is controlled by
the application instead of the logging facility.
A call to setlogmask( ) with a nonzero value for the maskpri parameter sets the priority mask to
the specified value and returns the previous value of the mask. A call to the setlogmask( ) func-
tion with maskpri set to 0 (zero) returns the current mask value and does not change that value.
The mask for an individual priority pri is calculated by the macro LOG_MASK(pri). The mask
for all priorities up to and including toppri is given by the macro LOG_UPTO(toppri).
Refer to the syslog(3) reference page for a description of supported priorities.
RETURN VALUES
Upon successful completion, the setlogmask( ) function returns the value of the current or previ-
ous event log mask. The setlogmask( ) function does not return the value -1 to indicate unsuc-
cessful completion. The errno variable is not set.
RELATED INFORMATION
Functions: closelog(3), openlog(3), syslog(3).
Commands: logger(1).
6−40 Hewlett-Packard Company 527187-017