Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 4268)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 4273)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.289 2005-06-15 02:58:05 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.290 2005-06-15 19:57:10 eugene Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -11,5 +11,5 @@
 \project{Pan-STARRS Image Processing Pipeline}
 \organization{Institute for Astronomy}
-\version{14}
+\version{15}
 \docnumber{PSDC-430-007}
 
@@ -43,7 +43,8 @@
 10 & 2004 Nov 30 & update for cycle 4 \\ \hline
 11 & 2005 Jan 21 & draft for cycle 5 \\ \hline
-12 & 2005 Feb 09 & final for cycle 5 \\
-13 & 2005 Mar 30 & draft for cycle 6 \\
-14 & 2005 Apr 27 & final for cycle 6 \\
+12 & 2005 Feb 09 & final for cycle 5 \\ \hline
+13 & 2005 Mar 30 & draft for cycle 6 \\ \hline
+14 & 2005 Apr 27 & final for cycle 6 \\ \hline
+15 & 2005 Jun 15 & draft for cycle 7 \\ \hline
 \RevisionsEnd
 
@@ -157,11 +158,12 @@
 
 \begin{itemize}
-\item The memory management functions, defined below, must be written
-  to be thread-safe, since we cannot risk this crucial area being
+\item The memory management and error stack functions, defined below
+  (Sections~\ref{sec:memory} \&~\ref{sec:errors}), must be written to
+  be thread-safe, since we cannot risk this crucial area being
   unstable.
 \item Re-entrant versions of system calls and external library
   functions should be used.  We expect that these cases are
   sufficiently small that we are prepared to err on the side of
-  caution.
+  caution. 
 \item The practise of using \code{static} variable to achieve high
   efficiency (e.g., so that subsequent calls do not have to repeat a
@@ -315,4 +317,5 @@
 
 \subsubsection{Memory Management}
+\label{sec:memory}
 
 In the following sections, we specify the API set and define the
@@ -1219,9 +1222,9 @@
 %
 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 trace messages in
-the form:
+\code{L} (level), \code{M} (message), \code{N} (name), \code{F}
+(file:name), and \code{T} (time).  The default is \code{THLNM}, which
+produces trace messages in the form:
 \begin{verbatim}
-YYYY-MM-DD hh:mm:ssZ | hostname | L | name
+YYYY-MM-DD hh:mm:ssZ | hostname | L | name | file:line
     The message goes here
     and is indented by 4 spaces.
@@ -1229,18 +1232,16 @@
 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 trace message was received.  Note
-that the timestamp is in ISO order, and that the timezone is GMT
+(0--23), minutes, and seconds when the trace 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{facil} and \code{msg}, are the
-arguments to \code{psTrace}.  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:
+\code{gethostname}, \code{L} is the numerical level. The other two
+fields, \code{name} and \code{msg}, are the facility name and the
+complete message provided to \code{psTrace}.  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
+2004:02:24 20:14:18Z | alibaba.IfA.Hawaii.Edu | I | example.utils.helloWorld | example.c:20
     Hello world,
     it's me calling.
@@ -1308,4 +1309,10 @@
 \code{PS_LOG_INFO}.
 
+\begin{prototype}
+int psLogGetLevel();           
+\end{prototype}
+%
+This function returns the current log level.  
+
 Log messages are sent to the destination most recently set using:
 %
@@ -1334,9 +1341,9 @@
 %
 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:
+\code{L} (level), \code{M} (message), \code{N} (name), \code{F}
+(file:line), 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
+YYYY-MM-DD hh:mm:ssZ | hostname | L | name | file:line
     The message goes here
     and is indented by 4 spaces.
@@ -1391,4 +1398,5 @@
 
 \subsection{Error Handling}
+\label{sec:errors}
 \hlabel{errorStack}
 
@@ -1400,9 +1408,14 @@
 returns the error code.
 \begin{prototype}
-psErrorCode p_psError(const char *filename, unsigned int lineno, const char *func, psErrorCode code,
-                      bool new, const char *format, ...);
-\end{prototype}
-\begin{datatype}
-#define psError(code, new, format, ...) psError(__FILE__, __LINE__, __func__, code, new, format, __VA_ARGS__)
+psErrorCode p_psError(const char *filename, 
+                      unsigned int lineno, 
+                      const char *func, 
+		      psErrorCode code,
+                      bool new, 
+		      const char *format, ...);
+\end{prototype}
+\begin{datatype}
+#define psError(code, new, format, ...) \
+    p_psError(__FILE__, __LINE__, __func__, code, new, format, __VA_ARGS__)
 \end{datatype}
 
