[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    Re: [ ruby-Bugs-2746 ] Syslog cannot log messages with %s in them
From:       WATANABE Hirofumi <eban () os ! rim ! or ! jp>
Date:       2005-10-29 18:36:42
Message-ID: 20051030033632.427018.eban () os ! rim ! or ! jp
[Download RAW message or body]

Hi,

noreply@rubyforge.org <noreply@rubyforge.org> writes:

> If you try to log a message which could be substituted by printf to Syslog, you get \
> an exception: 
> luke@sol10b(13) $ irb
> irb(main):001:0> require 'syslog'
> => true
> irb(main):002:0> Syslog.open("testing")
> => <#Syslog: opened=true, ident="testing", options=3, facility=8, mask=255>
> irb(main):003:0> Syslog.info("testing%s")
> ArgumentError: too few argument.
> from (irb):3:in `info'
> from (irb):3
> 
> I have not yet found a workaround.  Escaping the percent sign using a backslash \
> (unsurprisingly) does not work.

% irb
> > require "syslog"
=> true
> > Syslog.open("testing")
=> <#Syslog: opened=true, ident="testing", options=3, facility=8, mask=255>
> > Syslog.info("testing%%s")
=> <#Syslog: opened=true, ident="testing", options=3, facility=8, mask=255>

-- 
eban


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic