Bewerken

Delen via


Logging Routines and Macros

RDBSS provides a number of routines for logging. These logging facilities are always present. When the RDBSSLOG macro is defined, a generation of the logging calls on checked builds is enabled. When NO_RDBSSLOG is set, the logging calls are disabled.

The logging routines create log records that are stored in a circular buffer. Each record is bounded on either side by a record descriptor. This record descriptor is four bytes long.

The following table includes logging routines.

Routine Description

RxLogEventDirect

This routine is called to log an error to the I/O error log.

It is recommended that the RxLogFailure or RxLogEvent macro be used instead of calling this routine directly.

RxLogEventWithAnnotation

This routine allocates an I/O error log record, fills in the log record, and writes this record to the I/O error log.

RxLogEventWithBufferDirect

This routine allocates an I/O error log record, fills in the log record, and writes this record to the I/O error log. This routine encodes the line number and status into the raw data buffer stored in the I/O error log record.

It is recommended that the RxLogFailureWithBuffer macro be used instead of calling this routine directly.

_RxLog

This routine takes a format string and variable number of parameters and formats an output string for recording as an I/O error log entry if logging is enabled.

It is recommended that the RxLog macro be used instead of calling this routine directly.

This routine is only available on checked builds of RDBSS on Windows Server 2003, Windows XP, and Windows 2000.

The following macros are defined in the rxlog.h and rxprocs.h header files that call the routines listed in the previous table. These macros are normally used instead of calling these routines directly.

Macro Description

RxLog(Args)

On checked builds, this macro calls the _RxLog routine.

On retail builds, this macro does nothing.

Note that the arguments to RxLog must be enclosed with an additional pair of parenthesis to enable translation into a null call when logging should be turned off.

RxLogEvent (_DeviceObject, _OriginatorId, _EventId, _Status)

This macro calls the RxLogEventDirect routine.

RxLogFailure (_DeviceObject, _OriginatorId, _EventId, _Status)

This macro calls the RxLogEventDirect routine.

RxLogFailureWithBuffer (_DeviceObject, _OriginatorId, _EventId, _Status, _Buffer, _Length)

This macro calls the RxLogEventWithBufferDirect routine.

RxLogRetail(Args)

On checked builds, this macro calls the _RxLog routine.

On retail builds, this macro does nothing.

Note that the arguments to RxLogRetail must be enclosed with an additional pair of parenthesis to enable translation into a null call when logging should be turned off.