IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

File:
1 edited

Legend:

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

    r1807 r2204  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-09-14 20:01:52 $
     13 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-10-27 00:57:31 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1919/*****************************************************************************
    2020NOTES: currently, the prototype code has the following global variables:
    21     static int p_psGlobalLogDest;
    22     static int p_psGlobalLogLevel;
    23     static int p_psLogTime;
    24     static int p_psLogHost;
    25     static int p_psLogLevel;
    26     static int p_psLogName;
    27     static int p_psLogMsg;
     21    static psS32 p_psGlobalLogDest;
     22    static psS32 p_psGlobalLogLevel;
     23    static psS32 p_psLogTime;
     24    static psS32 p_psLogHost;
     25    static psS32 p_psLogLevel;
     26    static psS32 p_psLogName;
     27    static psS32 p_psLogMsg;
    2828 *****************************************************************************/
    2929#include <limits.h>
     
    3434#include <time.h>
    3535#include <unistd.h>
    36 #include <stdbool.h>
    3736
    3837#include "psLogMsg.h"
     
    4948
    5049static FILE *logDest = (FILE *) 1;      // flag to initialize to stderr before using.
    51 static int globalLogLevel = PS_LOG_INFO;        // log all messages at this or above
    52 static bool logTime = true;     // Flag to include time info
    53 static bool logHost = true;     // Flag to include host info
    54 static bool logLevel = true;    // Flag to include level info
    55 static bool logName = true;     // Flag to include name info
    56 static bool logMsg = true;      // Flag to include message info
     50static psS32 globalLogLevel = PS_LOG_INFO;        // log all messages at this or above
     51static psBool logTime = true;     // Flag to include time info
     52static psBool logHost = true;     // Flag to include host info
     53static psBool logLevel = true;    // Flag to include level info
     54static psBool logName = true;     // Flag to include name info
     55static psBool logMsg = true;      // Flag to include message info
    5756
    5857/*****************************************************************************
    5958psLogSetLevel(): Set the current log level and return old level.
    6059Input:
    61  level (int): the new log level.
     60 level (psS32): the new log level.
    6261Output:
    6362 none
     
    6564 The old log level.
    6665 *****************************************************************************/
    67 int psLogSetLevel(int level)
     66psS32 psLogSetLevel(psS32 level)
    6867{
    6968    // Save old global log level for changing it.
    70     int oldLevel = globalLogLevel;
     69    psS32 oldLevel = globalLogLevel;
    7170
    7271    if ((level < MIN_LOG_LEVEL) || (level > MAX_LOG_LEVEL)) {
     
    8685 
    8786Input:
    88  dest (int): the new log destination
     87 dest (psS32): the new log destination
    8988Output:
    9089 None.
     
    9291 An integer specifying the old log destination.
    9392 *****************************************************************************/
    94 bool psLogSetDestination(const char *dest)
     93psBool psLogSetDestination(const char *dest)
    9594{
    9695    char protocol[5];
     
    245244 NULL.
    246245 *****************************************************************************/
    247 void psLogMsgV(const char *name, int level, const char *fmt, va_list ap)
    248 {
    249     static int first = 1;       // Flag for calling gethostname()
     246void psLogMsgV(const char *name, psS32 level, const char *fmt, va_list ap)
     247{
     248    static psS32 first = 1;       // Flag for calling gethostname()
    250249    static char hostname[HOST_NAME_MAX + 1];
    251250
     
    254253    char head[MAX_LOG_LINE_LENGTH + 2]; // the added two are for the ending | and \0
    255254    char *head_ptr = head;      // where we've got to in head
    256     int maxLength = MAX_LOG_LINE_LENGTH;
     255    psS32 maxLength = MAX_LOG_LINE_LENGTH;
    257256    time_t clock = time(NULL);  // The current time.
    258257    struct tm *utc = gmtime(&clock);    // The current gm time.
     
    375374 NULL
    376375 *****************************************************************************/
    377 void psLogMsg(const char *name, int level, const char *fmt, ...)
     376void psLogMsg(const char *name, psS32 level, const char *fmt, ...)
    378377{
    379378    va_list ap;
Note: See TracChangeset for help on using the changeset viewer.