#189 closed defect (fixed)
error name size and message logging.
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The SDRS states that the error name "is of the form aaa.bbb.ccc and identifies
the component raising the error." (ref:sec 2.5) Also, the message logging
section (2.4.2) limits the output of the name in the log to be only 15
characters.
If I interpret the aaa.bbb.ccc form to be a specific identifier in the form
lib.subdir.function (e.g., psLib.sysUtils.psLogSetDestination), this makes for
a name in which is much more than 15 characters long. In fact, the lib.subdir
is all that fits in the log message at all. I adjusted the log output to
print the last part of the name instead of the first, but I don't know if that
is really desirable either.
We could:
- do nothing;
- increase the name size in the message log;
- reformat the message log to be multiple lines (more like the cvs log
format); and/or
- specify a shorter naming convention.
What are your thoughts?
-rdd
Change History (3)
comment:1 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 22 years ago
| Keywords: | VERIFIED added |
|---|
Closing subsequent to release of SDRS-08, ADD-07.
comment:3 by , 22 years ago
| Keywords: | VERIFIED removed |
|---|

Let's go with option 3. I patched the SDRS (see below). The substance of the
change is that the "name" may take the rest of the line, and the message starts
on the line below, with each line indented by four spaces (i.e., "\n" in the msg
must end up being "\n ").
The output format is controlled with the function:
%
\begin{verbatim}
void psLogSetFormat(const char *fmt);
\end{verbatim}
%
which expects a string consisting of the letters \code{H} (host),
\code{L} (level), \code{M} (message), \code{N} (name), and \code{T}
(time). The default is \code{THLNM}, which produces log messages in
the form:
\begin{verbatim}
YYYY:MM:DD hh:mm:ssZ | hostname | L | name
\end{verbatim}
where \code{YYYY}, \code{MM}, \code{DD}, \code{hh}, \code{mm}, and
\code{ss} are the year, month (Jan is 01), day of the month, hours
(0--23), minutes, and seconds when the log message was received. Note
that the timestamp is in ISO order, and that the timezone is GMT
(hence the \code{Z}). The \code{hostname} is returned by
\code{gethostname}, \code{L} is a character associated with the level
(\code{A}, \code{E}, \code{W}, and \code{I} for \code{PS_LOG_ABORT},
\code{PS_LOG_ERROR}, \code{PS_LOG_WARN}, and \code{PS_LOG_INFO}
respectively. Other levels are represented numerically (\code{5}
etc.). The other two fields, \code{name} and \code{msg}, are the
arguments to \code{psLogMsg}. The \code{msg} is placed on a new line
(allowing the \code{name} to fill the rest of the previous line),
with each line indented by 4 spaces. An example message is:
%
\begin{verbatim}
2004:02:24 20:14:18Z | alibaba.IfA.Hawaii.Edu | I | example.utils.helloWorld
\end{verbatim}
%
The possible order of the format entries is fixed and not determined
by the order of the letters used in \code{psLogSetFormat}. Selecting
an output format with fewer than the complete set of 5 entries simply
removes those entries from the output messages.