IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4273


Ignore:
Timestamp:
Jun 15, 2005, 9:57:10 AM (21 years ago)
Author:
eugene
Message:

updates to trace/log

Location:
trunk/doc/pslib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/ChangeLogSDRS.tex

    r4268 r4273  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.146 2005-06-15 02:58:05 price Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.147 2005-06-15 19:57:10 eugene Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    577577\end{itemize}
    578578
    579 \subsection{Changes from Revision 14 (27 April 2005) to Revision 15 (...)}
     579\subsection{Changes from Revision 14 (27 April 2005) to Revision 15 (15 June 2005)}
    580580
    581581\begin{itemize}
     
    726726\item add \code{limit} param to \code{psDBDeleteRows()}
    727727\item change \code{p_psDBRunQuery()} to accept a \code{printf()} style format
    728 \end{itemize}
     728\item added F (file:line) to psLogMsg and psTrace
     729\item added psLogGetLevel
     730\end{itemize}
  • trunk/doc/pslib/psLibSDRS.tex

    r4268 r4273  
    1 %%% $Id: psLibSDRS.tex,v 1.289 2005-06-15 02:58:05 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.290 2005-06-15 19:57:10 eugene Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    1111\project{Pan-STARRS Image Processing Pipeline}
    1212\organization{Institute for Astronomy}
    13 \version{14}
     13\version{15}
    1414\docnumber{PSDC-430-007}
    1515
     
    434310 & 2004 Nov 30 & update for cycle 4 \\ \hline
    444411 & 2005 Jan 21 & draft for cycle 5 \\ \hline
    45 12 & 2005 Feb 09 & final for cycle 5 \\
    46 13 & 2005 Mar 30 & draft for cycle 6 \\
    47 14 & 2005 Apr 27 & final for cycle 6 \\
     4512 & 2005 Feb 09 & final for cycle 5 \\ \hline
     4613 & 2005 Mar 30 & draft for cycle 6 \\ \hline
     4714 & 2005 Apr 27 & final for cycle 6 \\ \hline
     4815 & 2005 Jun 15 & draft for cycle 7 \\ \hline
    4849\RevisionsEnd
    4950
     
    157158
    158159\begin{itemize}
    159 \item The memory management functions, defined below, must be written
    160   to be thread-safe, since we cannot risk this crucial area being
     160\item The memory management and error stack functions, defined below
     161  (Sections~\ref{sec:memory} \&~\ref{sec:errors}), must be written to
     162  be thread-safe, since we cannot risk this crucial area being
    161163  unstable.
    162164\item Re-entrant versions of system calls and external library
    163165  functions should be used.  We expect that these cases are
    164166  sufficiently small that we are prepared to err on the side of
    165   caution.
     167  caution. 
    166168\item The practise of using \code{static} variable to achieve high
    167169  efficiency (e.g., so that subsequent calls do not have to repeat a
     
    315317
    316318\subsubsection{Memory Management}
     319\label{sec:memory}
    317320
    318321In the following sections, we specify the API set and define the
     
    12191222%
    12201223which expects a string consisting of the letters \code{H} (host),
    1221 \code{L} (level), \code{M} (message), \code{N} (name), and \code{T}
    1222 (time).  The default is \code{THLNM}, which produces trace messages in
    1223 the form:
     1224\code{L} (level), \code{M} (message), \code{N} (name), \code{F}
     1225(file:name), and \code{T} (time).  The default is \code{THLNM}, which
     1226produces trace messages in the form:
    12241227\begin{verbatim}
    1225 YYYY-MM-DD hh:mm:ssZ | hostname | L | name
     1228YYYY-MM-DD hh:mm:ssZ | hostname | L | name | file:line
    12261229    The message goes here
    12271230    and is indented by 4 spaces.
     
    12291232where \code{YYYY}, \code{MM}, \code{DD}, \code{hh}, \code{mm}, and
    12301233\code{ss} are the year, month (Jan is 01), day of the month, hours
    1231 (0--23), minutes, and seconds when the trace message was received.  Note
    1232 that the timestamp is in ISO order, and that the timezone is GMT
     1234(0--23), minutes, and seconds when the trace message was received.
     1235Note that the timestamp is in ISO order, and that the timezone is GMT
    12331236(hence the \code{Z}).  The \code{hostname} is returned by
    1234 \code{gethostname}, \code{L} is a character associated with the level
    1235 (\code{A}, \code{E}, \code{W}, and \code{I} for \code{PS_LOG_ABORT},
    1236 \code{PS_LOG_ERROR}, \code{PS_LOG_WARN}, and \code{PS_LOG_INFO}
    1237 respectively. Other levels are represented numerically (\code{5}
    1238 etc.). The other two fields, \code{facil} and \code{msg}, are the
    1239 arguments to \code{psTrace}.  The \code{msg} is placed on a new line
    1240 (allowing the \code{name} to fill the rest of the previous line),
    1241 with each line indented by 4 spaces.  An example message is:
     1237\code{gethostname}, \code{L} is the numerical level. The other two
     1238fields, \code{name} and \code{msg}, are the facility name and the
     1239complete message provided to \code{psTrace}.  The \code{msg} is placed
     1240on a new line (allowing the \code{name} to fill the rest of the
     1241previous line), with each line indented by 4 spaces.  An example
     1242message is:
    12421243%
    12431244\begin{verbatim}
    1244 2004:02:24 20:14:18Z | alibaba.IfA.Hawaii.Edu | I | example.utils.helloWorld
     12452004:02:24 20:14:18Z | alibaba.IfA.Hawaii.Edu | I | example.utils.helloWorld | example.c:20
    12451246    Hello world,
    12461247    it's me calling.
     
    13081309\code{PS_LOG_INFO}.
    13091310
     1311\begin{prototype}
     1312int psLogGetLevel();           
     1313\end{prototype}
     1314%
     1315This function returns the current log level. 
     1316
    13101317Log messages are sent to the destination most recently set using:
    13111318%
     
    13341341%
    13351342which expects a string consisting of the letters \code{H} (host),
    1336 \code{L} (level), \code{M} (message), \code{N} (name), and \code{T}
    1337 (time).  The default is \code{THLNM}, which produces log messages in
    1338 the form:
     1343\code{L} (level), \code{M} (message), \code{N} (name), \code{F}
     1344(file:line), and \code{T} (time).  The default is \code{THLNM}, which
     1345produces log messages in the form:
    13391346\begin{verbatim}
    1340 YYYY-MM-DD hh:mm:ssZ | hostname | L | name
     1347YYYY-MM-DD hh:mm:ssZ | hostname | L | name | file:line
    13411348    The message goes here
    13421349    and is indented by 4 spaces.
     
    13911398
    13921399\subsection{Error Handling}
     1400\label{sec:errors}
    13931401\hlabel{errorStack}
    13941402
     
    14001408returns the error code.
    14011409\begin{prototype}
    1402 psErrorCode p_psError(const char *filename, unsigned int lineno, const char *func, psErrorCode code,
    1403                       bool new, const char *format, ...);
    1404 \end{prototype}
    1405 \begin{datatype}
    1406 #define psError(code, new, format, ...) psError(__FILE__, __LINE__, __func__, code, new, format, __VA_ARGS__)
     1410psErrorCode p_psError(const char *filename,
     1411                      unsigned int lineno,
     1412                      const char *func,
     1413                      psErrorCode code,
     1414                      bool new,
     1415                      const char *format, ...);
     1416\end{prototype}
     1417\begin{datatype}
     1418#define psError(code, new, format, ...) \
     1419    p_psError(__FILE__, __LINE__, __func__, code, new, format, __VA_ARGS__)
    14071420\end{datatype}
    14081421
Note: See TracChangeset for help on using the changeset viewer.