1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/syslog/syslog.c: improve rdoc.

a patch by Jonas Pfenniger. [ruby-core:35592] fixes #4545

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2011-04-03 13:58:32 +00:00
parent 11b1f4ff92
commit 6a06e94046
2 changed files with 19 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Sun Apr 3 22:52:22 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* ext/syslog/syslog.c: improve rdoc.
a patch by Jonas Pfenniger. [ruby-core:35592] fixes #4545
Sun Apr 3 22:10:09 2011 Tanaka Akira <akr@fsij.org> Sun Apr 3 22:10:09 2011 Tanaka Akira <akr@fsij.org>
* ext/zlib/zlib.c: parenthesize macro arguments. * ext/zlib/zlib.c: parenthesize macro arguments.

View file

@ -178,7 +178,7 @@ static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
} }
/* call-seq: /* call-seq:
* open(ident, options, facility) => syslog * reopen(ident, options, facility) => syslog
* *
* :yields: syslog * :yields: syslog
* *
@ -193,7 +193,9 @@ static VALUE mSyslog_reopen(int argc, VALUE *argv, VALUE self)
return mSyslog_open(argc, argv, self); return mSyslog_open(argc, argv, self);
} }
/* /* call-seq:
* opened?
*
* Returns true if the syslog is open. * Returns true if the syslog is open.
*/ */
static VALUE mSyslog_isopen(VALUE self) static VALUE mSyslog_isopen(VALUE self)
@ -231,7 +233,7 @@ static VALUE mSyslog_get_mask(VALUE self)
} }
/* call-seq: /* call-seq:
* mask(priority_mask) * mask=(priority_mask)
* *
* Sets the log priority mask. A method LOG_UPTO is defined to make it easier * Sets the log priority mask. A method LOG_UPTO is defined to make it easier
* to set mask values. Example: * to set mask values. Example:
@ -258,12 +260,12 @@ static VALUE mSyslog_set_mask(VALUE self, VALUE mask)
} }
/* call-seq: /* call-seq:
* log(priority, format-string, ... ) * log(priority, format_string, *format_args)
* *
* Log a message with the specified priority. Example: * Log a message with the specified priority. Example:
* *
* log(Syslog::LOG_CRIT, "Out of disk space") * Syslog.log(Syslog::LOG_CRIT, "Out of disk space")
* log(Syslog::LOG_CRIT, "User %s logged in", ENV['USER']) * Syslog.log(Syslog::LOG_CRIT, "User %s logged in", ENV['USER'])
* *
* The priority levels, in descending order, are: * The priority levels, in descending order, are:
* *
@ -276,6 +278,12 @@ static VALUE mSyslog_set_mask(VALUE self, VALUE mask)
* LOG_INFO:: Informational message * LOG_INFO:: Informational message
* LOG_DEBUG:: Debugging information * LOG_DEBUG:: Debugging information
* *
* Each priority level also has a shortcut 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 * Format strings are as for printf/sprintf, except that in addition %m is
* replaced with the error message string that would be returned by * replaced with the error message string that would be returned by
* strerror(errno). * strerror(errno).