Bug #4545 ยป 0001-syslog-extension-documentation-improvement-and-fixes.patch
| ext/syslog/syslog.c | ||
|---|---|---|
|
}
|
||
|
/* call-seq:
|
||
|
* open(ident, options, facility) => syslog
|
||
|
* reopen(ident, options, facility) => syslog
|
||
|
*
|
||
|
* :yields: syslog
|
||
|
*
|
||
| ... | ... | |
|
return mSyslog_open(argc, argv, self);
|
||
|
}
|
||
|
/*
|
||
|
/* call-seq:
|
||
|
* opened?
|
||
|
*
|
||
|
* Returns true if the syslog is open.
|
||
|
*/
|
||
|
static VALUE mSyslog_isopen(VALUE self)
|
||
| ... | ... | |
|
}
|
||
|
/* call-seq:
|
||
|
* mask(priority_mask)
|
||
|
* mask=(priority_mask)
|
||
|
*
|
||
|
* Sets the log priority mask. A method LOG_UPTO is defined to make it easier
|
||
|
* to set mask values. Example:
|
||
| ... | ... | |
|
}
|
||
|
/* call-seq:
|
||
|
* log(priority, format-string, ... )
|
||
|
* log(priority, format_string, *format_args)
|
||
|
*
|
||
|
* Log a message with the specified priority. Example:
|
||
|
*
|
||
|
* log(Syslog::LOG_CRIT, "Out of disk space")
|
||
|
* log(Syslog::LOG_CRIT, "User %s logged in", ENV['USER'])
|
||
|
* Syslog.log(Syslog::LOG_CRIT, "Out of disk space")
|
||
|
* Syslog.log(Syslog::LOG_CRIT, "User %s logged in", ENV['USER'])
|
||
|
*
|
||
|
* The priority levels, in descending order, are:
|
||
|
*
|
||
| ... | ... | |
|
* LOG_INFO:: Informational message
|
||
|
* LOG_DEBUG:: Debugging information
|
||
|
*
|
||
|
* Each priority level also has a shotcut method that logs with it's named priority.
|
||
|
* As an example, the two following statements would produce the same result:
|
||
|
*
|
||
|
* Syslog.log(Syslog::LOG_ALERT, "Out of memory")
|
||
|
* Syslog.alert("Out of memory")
|
||
|
*
|
||
|
* Format strings are as for printf/sprintf, except that in addition %m is
|
||
|
* replaced with the error message string that would be returned by
|
||
|
* strerror(errno).
|
||