[#33640] [Ruby 1.9-Bug#4136][Open] Enumerable#reject should not inherit the receiver's instance variables — Hiro Asari <redmine@...>

Bug #4136: Enumerable#reject should not inherit the receiver's instance variables

10 messages 2010/12/08

[#33667] [Ruby 1.9-Bug#4149][Open] Documentation submission: syslog standard library — mathew murphy <redmine@...>

Bug #4149: Documentation submission: syslog standard library

11 messages 2010/12/10

[#33683] [feature:trunk] Enumerable#categorize — Tanaka Akira <akr@...>

Hi.

14 messages 2010/12/12
[#33684] Re: [feature:trunk] Enumerable#categorize — "Martin J. Dst" <duerst@...> 2010/12/12

[#33687] Towards a standardized AST for Ruby code — Magnus Holm <judofyr@...>

Hey folks,

23 messages 2010/12/12
[#33688] Re: Towards a standardized AST for Ruby code — Charles Oliver Nutter <headius@...> 2010/12/12

On Sun, Dec 12, 2010 at 9:55 AM, Magnus Holm <judofyr@gmail.com> wrote:

[#33689] Re: Towards a standardized AST for Ruby code — "Haase, Konstantin" <Konstantin.Haase@...> 2010/12/12

On Dec 12, 2010, at 17:46 , Charles Oliver Nutter wrote:

[#33763] [Ruby 1.9-Bug#4168][Open] WeakRef is unsafe to use in Ruby 1.9 — Brian Durand <redmine@...>

Bug #4168: WeakRef is unsafe to use in Ruby 1.9

43 messages 2010/12/17

[#33815] trunk warnflags build issue with curb 0.7.9? — Jon <jon.forums@...>

As this may turn out to be a 3rd party issue rather than a bug, I'd like some feedback.

11 messages 2010/12/22

[#33833] Ruby 1.9.2 is going to be released — "Yuki Sonoda (Yugui)" <yugui@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2010/12/23

[#33846] [Ruby 1.9-Feature#4197][Open] Improvement of the benchmark library — Benoit Daloze <redmine@...>

Feature #4197: Improvement of the benchmark library

15 messages 2010/12/23

[#33910] [Ruby 1.9-Feature#4211][Open] Converting the Ruby and C API documentation to YARD syntax — Loren Segal <redmine@...>

Feature #4211: Converting the Ruby and C API documentation to YARD syntax

10 messages 2010/12/26

[#33923] [Ruby 1.9-Bug#4214][Open] Fiddle::WINDOWS == false on Windows — Jon Forums <redmine@...>

Bug #4214: Fiddle::WINDOWS == false on Windows

15 messages 2010/12/27

[ruby-core:33673] [Ruby 1.9-Bug#4149] Documentation submission: syslog standard library

From: mathew murphy <redmine@...>
Date: 2010-12-10 20:57:08 UTC
List: ruby-core #33673
Issue #4149 has been updated by mathew murphy.

File syslog.patch added

That's very strange, I definitely remember the annoyance of having to navigate my way to it with the file selector, and my browser still has the string I typed for the description in its autocomplete history. Redmine bug perhaps? 

Anyway, here it is again.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/4149

----------------------------------------
http://redmine.ruby-lang.org

Attachments (1)

syslog.patch (6.91 KB, text/x-diff)
Index: syslog.c
===================================================================
--- syslog.c	(revision 30063)
+++ syslog.c	(working copy)
@@ -2,6 +2,7 @@
  * UNIX Syslog extension for Ruby
  * Amos Gouaux, University of Texas at Dallas
  * <amos+ruby@utdallas.edu>
+ * Documented by mathew <meta@pobox.com>
  *
  * $RoughId: syslog.c,v 1.21 2002/02/25 12:21:17 knu Exp $
  * $Id$
@@ -36,7 +37,8 @@
     syslog(pri, "%s", RSTRING_PTR(str));
 }
 
-/* Syslog module methods */
+/* Close the syslog facility.
+ */
 static VALUE mSyslog_close(VALUE self)
 {
     rb_secure(4);
@@ -54,6 +56,82 @@
     return Qnil;
 }
 
+/* Open the syslog facility.
+ *
+ * Can be called with or without a code block:
+ *
+ *  open(ident, options, facility) => Syslog object
+ *
+ *  open(ident, options, facility) {|syslog| ...}
+ *
+ * If called with a block, the Syslog object created is passed to the block.
+ *
+ * If the syslog is already open, raises a RuntimeError.
+ *
+ * +ident+ is a string which identifies the calling program.
+ *
+ * +options+ is the logical OR of any of the following:
+ *
+ * * LOG_CONS: If there is an error while sending to the system logger,
+ *   write directly to the console instead.
+ *
+ * * LOG_NDELAY: Open the connection now, rather than waiting for the first
+ *   message to be written.
+ *
+ * * LOG_NOWAIT: Don't wait for any child processes created while logging
+ *   messages. (Has no effect on Linux.)
+ *
+ * * LOG_ODELAY: Opposite of LOG_NDELAY; wait until a message is sent before
+ *   opening the connection. (This is the default.)
+ *
+ * * LOG_PERROR: Print the message to stderr as well as sending it to syslog.
+ *   (Not in POSIX.1-2001.)
+ *
+ * * LOG_PID: Include the current process ID with each message.
+ *
+ * +facility+ describes the type of program opening the syslog, and is 
+ * the logical OR of any of the following which are defined for the host OS:
+ *
+ * * LOG_AUTH: Security or authorization. Deprecated, use LOG_AUTHPRIV 
+ *   instead.
+ *
+ * * LOG_AUTHPRIV: Security or authorization messages which should be kept 
+ *   private.
+ *
+ * * LOG_CONSOLE: System console message.
+ *
+ * * LOG_CRON: System task scheduler (cron or at).
+ *
+ * * LOG_DAEMON: A system daemon which has no facility value of its own.
+ *
+ * * LOG_FTP: An FTP server.
+ *
+ * * LOG_KERN: A kernel message (not sendable by user processes, so not of 
+ *   much use to Ruby, but listed here for completeness).
+ *
+ * * LOG_LRP: Line printer subsystem.
+ *
+ * * LOG_MAIL: Mail delivery or transport subsystem.
+ *
+ * * LOG_NEWS: Usenet news system.
+ *
+ * * LOG_NTP: Network Time Protocol server.
+ *
+ * * LOG_SECURITY: General security message.
+ *
+ * * LOG_SYSLOG: Messages generated internally by syslog.
+ *
+ * * LOG_USER: Generic user-level message.
+ *
+ * * LOG_UUCP: UUCP subsystem.
+ *
+ * * LOG_LOCAL0 to LOG_LOCAL7: Locally-defined facilities.
+ *
+ * Example:
+ *
+ *  Syslog.open("webrick", Syslog::LOG_PID, Syslog::LOG_DAEMON | Syslog::LOG_LOCAL3)
+ *
+ */
 static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
 {
     VALUE ident, opt, fac;
@@ -96,6 +174,10 @@
     return self;
 }
 
+/* Closes and then reopens the syslog.
+ *
+ * Arguments are the same as for open().
+ */
 static VALUE mSyslog_reopen(int argc, VALUE *argv, VALUE self)
 {
     mSyslog_close(self);
@@ -103,31 +185,60 @@
     return mSyslog_open(argc, argv, self);
 }
 
+/*
+ * Returns true if the syslog is open.
+ */
 static VALUE mSyslog_isopen(VALUE self)
 {
     return syslog_opened ? Qtrue : Qfalse;
 }
 
+/*
+ * Returns the identity string used in the last call to open()
+ */
 static VALUE mSyslog_ident(VALUE self)
 {
     return syslog_opened ? rb_str_new2(syslog_ident) : Qnil;
 }
 
+/*
+ * Returns the options bitmask used in the last call to open()
+ */
 static VALUE mSyslog_options(VALUE self)
 {
     return syslog_opened ? INT2NUM(syslog_options) : Qnil;
 }
 
+/*
+ * Returns the facility number used in the last call to open()
+ */
 static VALUE mSyslog_facility(VALUE self)
 {
     return syslog_opened ? INT2NUM(syslog_facility) : Qnil;
 }
 
+/*
+ * Returns the log priority mask in effect. The mask is not reset by opening
+ * or closing syslog.
+ */
 static VALUE mSyslog_get_mask(VALUE self)
 {
     return syslog_opened ? INT2NUM(syslog_mask) : Qnil;
 }
 
+/*
+ * Sets the log priority mask. A method LOG_UPTO is defined to make it easier
+ * to set mask values. Example:
+ *
+ *   Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)
+ *
+ * Alternatively, specific priorities can be selected and added together using
+ * binary OR. Example:
+ *
+ *   Syslog.mask = Syslog::LOG_MASK(Syslog::LOG_ERR) | Syslog::LOG_MASK(Syslog::LOG_CRIT)
+ *
+ * The priority mask persists through calls to open() and close().
+ */
 static VALUE mSyslog_set_mask(VALUE self, VALUE mask)
 {
     rb_secure(4);
@@ -140,6 +251,23 @@
     return mask;
 }
 
+/*
+ * Log a message with the specified priority. Example:
+ *
+ *   log(Syslog::LOG_CRIT, "Out of disk space")
+ *
+ * The priority levels, in descending order, are:
+ *
+ * * LOG_EMERG - System is unusable
+ * * LOG_ALERT - Action needs to be taken immediately
+ * * LOG_CRIT - A critical condition has occurred
+ * * LOG_ERR - An error occurred
+ * * LOG_WARNING - Warning of a possible problem
+ * * LOG_NOTICE - A normal but significant condition occurred
+ * * LOG_INFO - Informational message
+ * * LOG_DEBUG - Debugging information
+ *
+ */
 static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
 {
     VALUE pri;
@@ -160,6 +288,9 @@
     return self;
 }
 
+/*
+ * Returns an inspect() string summarizing the object state.
+ */
 static VALUE mSyslog_inspect(VALUE self)
 {
     char buf[1024];
@@ -180,6 +311,9 @@
     return rb_str_new2(buf);
 }
 
+/*
+ * Returns self, for backward compatibility.
+ */
 static VALUE mSyslog_instance(VALUE self)
 {
     return self;
@@ -218,17 +352,36 @@
 define_syslog_shortcut_method(LOG_DEBUG, debug)
 #endif
 
+/*
+ * Generates a mask bit for a priority level. See #mask=
+ */
 static VALUE mSyslogConstants_LOG_MASK(VALUE klass, VALUE pri)
 {
     return INT2FIX(LOG_MASK(NUM2INT(pri)));
 }
 
+/* Generates a mask value for priority levels at or below the level specified.
+ * See #mask=
+ */
 static VALUE mSyslogConstants_LOG_UPTO(VALUE klass, VALUE pri)
 {
     return INT2FIX(LOG_UPTO(NUM2INT(pri)));
 }
 
-/* Init for package syslog */
+/* The syslog package provides a Ruby interface to the POSIX system logging
+ * facility. 
+ *
+ * Syslog messages are typically passed to a central logging daemon.
+ * The daemon may filter them; route them into different files (usually 
+ * found under /var/log); place them in SQL databases; forward 
+ * them to centralized logging servers via TCP or UDP; or even alert the
+ * system administrator via email, pager or text message.
+ *
+ * Unlike application-level logging via Logger or Log4r, syslog is designed
+ * to allow secure tamper-proof logging.
+ *
+ * The syslog protocol is standardized in RFC 5424.
+ */
 void Init_syslog()
 {
     mSyslog = rb_define_module("Syslog");

In This Thread