[gccsdk] Syslog: DoggySoft vs. Unix

Graham Shaw gdshaw at sagitta.demon.co.uk
Sat May 26 07:38:04 PDT 2007


In article <20070526124451.GA6464 at chiark.greenend.org.uk>,
   Theo Markettos <theo at markettos.org.uk> wrote:
> On Thu, May 24, 2007 at 10:02:11PM +0100, Adam wrote:
> > Only Nettle uses the unix scheme (CryptRand hasn't logged anything here
> > so I don't know what that does).

> CryptRand uses a scheme I made up (probably with reference to the
> existing Doggysoft implementation), so it doesn't use the Unix
> convention (which I didn't know about until this thread).

> One thought: if the syslog protocol is used to send messages to a
> syslogd on another machine (which does use the Unix scheme), does this
> cause problems? I think RO Adjust implements this, but I've never tried
> it.

That's a very good point.  I've just taken a look at RFC 3164, and it does
indeed specify what the particular numbers mean - which makes using the
Doggysoft scheme within the UnixLib API significantly less attractive.

For option 3 the obvious translation scheme would be:

  0 <-> 0 (emergency)
 32 <-> 1 (alert)
 64 <-> 2 (critical)
 96 <-> 3 (error)
128 <-> 4 (warning)
160 <-> 5 (notice)
192 <-> 6 (informational)
224 <-> 7 (debug)

but this gives numbers that are rather higher than would accord with the
Doggysoft documentation: notice really ought to be less than 125, and
warning no higher than 100.  Still it would be nice to have something that
was linear, perhaps:

  0 <-> 0 (emergency)
 20 <-> 1 (alert)
 40 <-> 2 (critical)
 60 <-> 3 (error)
 80 <-> 4 (warning)
100 <-> 5 (notice)
120 <-> 6 (informational)
140 <-> 7 (debug)

(Informational messages would then be logged by default - but only just -
whereas debug messages would not.)

-- 
Graham Shaw (http://www.sagitta.demon.co.uk/graham/)
The RISC OS Packaging Project (http://www.riscpkg.org/)
The RISC OS Toolkit (http://rtk.riscos.org.uk/)




More information about the gcc mailing list