qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Huston" <shus...@riverace.com>
Subject C++ - Question on how to handle logging options for Linux/Windows
Date Fri, 10 Oct 2008 15:04:22 GMT
Hi folks,

In working the Windows port of the C++ code, some command line options
need some work. Particularly in the case at hand, there are

  --log-output FILE (stderr)              Send log output to FILE.
FILE can be
                                          a file name or one of the
special
                                          values:
                                          stderr, stdout, syslog

  --syslog-name NAME (lt-qpidd)           Name to use in syslog
messages
  --syslog-facility LOG_XXX (LOG_DAEMON)  Facility to use in syslog
messages

To date, the approach I've been working on is to split the options
into common and platform-specific ones. This would make it relatively
easy to build in only the ones needed. For example, the syslog stuff
is not pertinent to Windows, but event logging options would be.

The issue at hand is the --log-output option because its values are
split between portable (stderr, stdout, filename) and
platform-specific (syslog).

I see two ways to handle this, and I am asking for your discussion and
advice.

1. Remove the 'syslog' value from --log-output and add a new option to
the platform-specific set; maybe --log-syslog yes|no

2. Leave the options as they are and specialize just the syslog
handling inside the code.

3. Don't try to split into common and platform-specific options; just
maintain completely separate option sets for each platform even though
90% of the code will be identical. At least to start...

I think #1 is the better way to go since it puts the output sink
option with the platform-specific things. You could argue that
"--log-output syslog" could be interpreted as "event log" on Windows,
but that is stretching it a  bit and the plan wouldn't carry to future
platforms (of which there certainly will be some!) which don't offer
any sort of syslog-like capability.

Thoughts?

-Steve


Mime
View raw message