Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

_diagassert(3) [netbsd man page]

_DIAGASSERT(3)						   BSD Library Functions Manual 					    _DIAGASSERT(3)

NAME
_DIAGASSERT -- expression verification macro SYNOPSIS
#include <assert.h> _DIAGASSERT(expression); DESCRIPTION
The _DIAGASSERT() macro tests the given expression and if it is false, one or more of the following may occur: o a diagnostic message may be logged to the system logger with syslog(3). This is default behaviour. o a diagnostic message may be printed to the stderr stream. o the calling process will be terminated by calling abort(3). This behaviour may be changed by setting the LIBC_DIAGASSERT environment variable (see below). The diagnostic message consists of the text of the expression, the name of the source file, the line number and the enclosing function. If expression is true, the _DIAGASSERT() macro does nothing. The _DIAGASSERT() macro is not compiled in by default, and will only be compiled in with the cc(1) option -D_DIAGNOSTIC. This macro is used in the various system libraries such as the Standard C Library (libc, -lc) to ensure that various library calls are invoked with valid arguments. ENVIRONMENT
The LIBC_DIAGASSERT environment variable can be used to modify the default behaviour of logging the assertion to the system logger. LIBC_DIAGASSERT may be set to one or more of the following characters: a abort(3) once any assertion messages have been logged and/or printed. A Opposite of ``a''. e Print the assertion message to the stderr stream. E Opposite of ``e''. l Log the assertion message with syslog(3) to the facility user.debug. L Opposite of ``l''. DIAGNOSTICS
The diagnostic message has the following format: "assertion "%s" failed: file "%s", line %d, function "%s" ", "expression", __FILE__, __LINE__, __func__ SEE ALSO
cc(1), abort(3), assert(3), syslog(3) HISTORY
The _DIAGASSERT macro appeared in NetBSD 1.5. BSD
January 22, 2007 BSD

Check Out this Related Man Page

logger(1)						      General Commands Manual							 logger(1)

NAME
logger - make entries in the system log SYNOPSIS
tag] pri] file] [message...] DESCRIPTION
The command provides a program interface to the system log module (see syslog(3C)). A message can be given on the command line, which is logged immediately, or a file is read and each line is logged. If no file or message is specified, the contents of the standard input are logged. Options The command recognizes the following command-line options and arguments: Mark every line in the log with the specified tag. The default is the value returned by (see getlogin(3C)). If returns NULL, is the default. Enter the message with the specified priority. The priority can be specified numerically or as a pair. For example, logs the message or messages as level in the facility. The default is Log the process ID of the logger process with each line. Log the contents of the specified file. message The message to log; if not specified, the file specified by the option or standard input is logged. EXTERNAL INFLUENCES
Environment Variables determines the language in which messages are displayed. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multi-byte character code sets are supported. EXAMPLES
Send the message to the daemon: Send output from the command (see users(1) to the daemon, marked as level and facility The message is tagged with the string Send the message to the daemon, at the level and facility: WARNINGS
The command has no effect if the daemon (see syslogd(1M)) is not running on the system. Messages written in locales other than the POSIX/C locale are not supported. AUTHOR
was developed by the University of California, Berkeley. SEE ALSO
syslogd(1M), getlogin(3C), syslog(3C). STANDARDS CONFORMANCE
logger(1)
Man Page