#508 closed defect (fixed)
psLogSetDestination is inconsistent
| Reported by: | Paul Price | Owned by: | Paul Price |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | robert.desonia@… |
Description
Some parts of the SDRS state:
Specifying a \code{format} of \code{NULL} turns off logging (equivalent
to calling \code{psLogSetDestination(PS_LOG_TO_NONE)}, whereas if the
\code{format} is \code{""}, then the format reverts to the default.
But the definition says:
bool psLogSetDestination(int fd);
If the \code{fd} is 0, then the log is sent to standard output,
otherwise it is sent to the specified file descriptor. A call to
\code{psLogSetDestination} automatically closes an open file
descriptor.
And the implementation has an enum, with PS_LOG_NONE = 0, which means that the
user thinks the logging is being turned on to stdout, but it's been disabled.
To fix this, I propose:
enum {
PS_LOG_TO_NONE = 0, /< turn off logging
PS_LOG_TO_STDOUT = 1, /< log to system's stdout
PS_LOG_TO_STDERR = 2, /< log to system's stderr
};
These values echo the file descriptor values for stdin, stdout and stderr,
repectively. I would argue that this makes the most sense.
I will fix the SDRS, if there are no objections.
Change History (2)
comment:1 by , 21 years ago
| Status: | new → assigned |
|---|
comment:2 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Updated the SDRS. It'll be in the next release.

Ditto for the trace messages.