IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 500


Ignore:
Timestamp:
Apr 21, 2004, 11:43:54 AM (22 years ago)
Author:
gusciora
Message:

cosmetic changes only

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psLogMsg.c

    r499 r500  
    11/*****************************************************************************
    22    A simple implementation of a logging facility for Pan-STARRS
     3 
     4NOTES: currently, the prototype code has the following global variables:
     5    static int logDest;
     6    static int logLevel;
     7    static int log_time;
     8    static int log_host;
     9    static int log_level;
     10    static int log_name;
     11    static int log_msg;
    312 *****************************************************************************/
    413#include <limits.h>
     
    2029static int logDest = PS_LOG_TO_STDERR; // where to log messages
    2130static int logLevel = PS_LOG_INFO;     // log all messages at this or above
     31// The following variables control
     32// which information is displayed in
     33// log messages.
     34static int log_time = 1;                // Flag to include time info
     35static int log_host = 1;                // Flag to include host info
     36static int log_level = 1;               // Flag to include level info
     37static int log_name = 1;                // Flag to include name info
     38static int log_msg = 1;                 // Flag to include message info
    2239/*****************************************************************************
    2340psSetLogLevel(): Set the current log level and return old level.
     
    3350    int oldLevel = logLevel;
    3451
    35     if ((level < MIN_LOG_LEVEL) ||
    36             (level > MAX_LOG_LEVEL)) {
     52    if ((level < MIN_LOG_LEVEL) || (level > MAX_LOG_LEVEL)) {
    3753        psLogMsg("logmsg", PS_LOG_WARN,
    3854                 "Attempt to set invalid logMsg level: %d", level);
     
    4763/*****************************************************************************
    4864psSetLogDestination(): sets the destination where log messages will be
    49  sent to.
     65sent to.
     66 
    5067Input:
    5168 dest (int): the new log destination
     
    7693
    7794
    78 static int log_time = 1;
    79 static int log_host = 1;
    80 static int log_level = 1;
    81 static int log_name = 1;
    82 static int log_msg = 1;
    83 /*****************************************************************************
    84     psSetLogFormat(): Set the format of psLogMsg output.  More precisely,
     95/*****************************************************************************
     96psSetLogFormat(): Set the format of psLogMsg output.  More precisely,
    8597    provide a string consisting of the letters {H (host), L (level), M
    8698    (message), N (name), T (time)}.  The default is "HLMNT".  This string
     
    88100    included in message logs.  It does not determine the order in which that
    89101    information will appear (that order is fixed).
    90     Input:
    91  fmt: a string specifying the format.
    92     Output:
    93  none.
    94     Return:
    95  NULL.
     102 
     103Input:
     104    fmt: a string specifying the format.
     105Output:
     106    none.
     107Return:
     108    NULL.
    96109 *****************************************************************************/
    97110void psSetLogFormat(const char *fmt)
     
    172185    static int first = 1;
    173186    static char hostname[HOST_NAME_MAX + 1];
    174     char clevel=0;   // letter-name for level
    175     char head[HOST_NAME_MAX + 40]; // yes, this is long enough
    176     char *head_ptr = head;  // where we've got to in head
     187    char clevel=0;                      // letter-name for level
     188    char head[HOST_NAME_MAX + 40];      // yes, this is long enough
     189    char *head_ptr = head;              // where we've got to in head
    177190    time_t clock = time(NULL);
    178191    struct tm *utc = gmtime(&clock);
    179192
    180     if ((level > logLevel) ||
    181             (logDest == PS_LOG_NONE)) {
     193    if ((level > logLevel) || (logDest == PS_LOG_NONE)) {
    182194        return;
    183195    }
  • trunk/psLib/src/sysUtils/psLogMsg.c

    r499 r500  
    11/*****************************************************************************
    22    A simple implementation of a logging facility for Pan-STARRS
     3 
     4NOTES: currently, the prototype code has the following global variables:
     5    static int logDest;
     6    static int logLevel;
     7    static int log_time;
     8    static int log_host;
     9    static int log_level;
     10    static int log_name;
     11    static int log_msg;
    312 *****************************************************************************/
    413#include <limits.h>
     
    2029static int logDest = PS_LOG_TO_STDERR; // where to log messages
    2130static int logLevel = PS_LOG_INFO;     // log all messages at this or above
     31// The following variables control
     32// which information is displayed in
     33// log messages.
     34static int log_time = 1;                // Flag to include time info
     35static int log_host = 1;                // Flag to include host info
     36static int log_level = 1;               // Flag to include level info
     37static int log_name = 1;                // Flag to include name info
     38static int log_msg = 1;                 // Flag to include message info
    2239/*****************************************************************************
    2340psSetLogLevel(): Set the current log level and return old level.
     
    3350    int oldLevel = logLevel;
    3451
    35     if ((level < MIN_LOG_LEVEL) ||
    36             (level > MAX_LOG_LEVEL)) {
     52    if ((level < MIN_LOG_LEVEL) || (level > MAX_LOG_LEVEL)) {
    3753        psLogMsg("logmsg", PS_LOG_WARN,
    3854                 "Attempt to set invalid logMsg level: %d", level);
     
    4763/*****************************************************************************
    4864psSetLogDestination(): sets the destination where log messages will be
    49  sent to.
     65sent to.
     66 
    5067Input:
    5168 dest (int): the new log destination
     
    7693
    7794
    78 static int log_time = 1;
    79 static int log_host = 1;
    80 static int log_level = 1;
    81 static int log_name = 1;
    82 static int log_msg = 1;
    83 /*****************************************************************************
    84     psSetLogFormat(): Set the format of psLogMsg output.  More precisely,
     95/*****************************************************************************
     96psSetLogFormat(): Set the format of psLogMsg output.  More precisely,
    8597    provide a string consisting of the letters {H (host), L (level), M
    8698    (message), N (name), T (time)}.  The default is "HLMNT".  This string
     
    88100    included in message logs.  It does not determine the order in which that
    89101    information will appear (that order is fixed).
    90     Input:
    91  fmt: a string specifying the format.
    92     Output:
    93  none.
    94     Return:
    95  NULL.
     102 
     103Input:
     104    fmt: a string specifying the format.
     105Output:
     106    none.
     107Return:
     108    NULL.
    96109 *****************************************************************************/
    97110void psSetLogFormat(const char *fmt)
     
    172185    static int first = 1;
    173186    static char hostname[HOST_NAME_MAX + 1];
    174     char clevel=0;   // letter-name for level
    175     char head[HOST_NAME_MAX + 40]; // yes, this is long enough
    176     char *head_ptr = head;  // where we've got to in head
     187    char clevel=0;                      // letter-name for level
     188    char head[HOST_NAME_MAX + 40];      // yes, this is long enough
     189    char *head_ptr = head;              // where we've got to in head
    177190    time_t clock = time(NULL);
    178191    struct tm *utc = gmtime(&clock);
    179192
    180     if ((level > logLevel) ||
    181             (logDest == PS_LOG_NONE)) {
     193    if ((level > logLevel) || (logDest == PS_LOG_NONE)) {
    182194        return;
    183195    }
Note: See TracChangeset for help on using the changeset viewer.