ruby-changes:19195
From: nagachika <ko1@a...>
Date: Sun, 3 Apr 2011 22:58:41 +0900 (JST)
Subject: [ruby-changes:19195] Ruby:r31234 (trunk): * ext/syslog/syslog.c: improve rdoc.
nagachika 2011-04-03 22:58:32 +0900 (Sun, 03 Apr 2011) New Revision: 31234 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31234 Log: * ext/syslog/syslog.c: improve rdoc. a patch by Jonas Pfenniger. [ruby-core:35592] fixes #4545 Modified files: trunk/ChangeLog trunk/ext/syslog/syslog.c Index: ChangeLog =================================================================== --- ChangeLog (revision 31233) +++ ChangeLog (revision 31234) @@ -1,3 +1,8 @@ +Sun Apr 3 22:52:22 2011 CHIKANAGA Tomoyuki <nagachika00@g...> + + * 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@f...> * ext/zlib/zlib.c: parenthesize macro arguments. Index: ext/syslog/syslog.c =================================================================== --- ext/syslog/syslog.c (revision 31233) +++ ext/syslog/syslog.c (revision 31234) @@ -178,7 +178,7 @@ } /* call-seq: - * open(ident, options, facility) => syslog + * reopen(ident, options, facility) => syslog * * :yields: syslog * @@ -193,7 +193,9 @@ return mSyslog_open(argc, argv, self); } -/* +/* call-seq: + * opened? + * * Returns true if the syslog is open. */ static VALUE mSyslog_isopen(VALUE self) @@ -231,7 +233,7 @@ } /* 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: @@ -258,12 +260,12 @@ } /* 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: * @@ -276,6 +278,12 @@ * LOG_INFO:: Informational message * 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 * replaced with the error message string that would be returned by * strerror(errno). -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/