IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 7, 2004, 9:05:07 AM (22 years ago)
Author:
desonia
Message:

added error stack to sysUtils

File:
1 edited

Legend:

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

    r1448 r1696  
    1212 *  @author George Gusciora, MHPCC
    1313 *
    14  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-10 01:55:34 $
     14 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-09-07 19:05:07 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4141#include "psTrace.h"
    4242
     43#include "psSysUtilsErrors.h"
     44#define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psLogMsg."
     45
    4346#define MIN_LOG_LEVEL 0
    4447#define MAX_LOG_LEVEL 9
    4548
    4649#define MAX_LOG_LINE_LENGTH 128
     50
     51
    4752static FILE *logDest = (FILE *) 1;      // flag to initialize to stderr before using.
    4853static int globalLogLevel = PS_LOG_INFO;        // log all messages at this or above
     
    108113
    109114    if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
    110         psError(__func__, "The specified destination, %s, is malformed.", dest);
     115        psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
     116                   PS_ERRORTEXT_psLogSetDestination_DESTINATION_MALFORMED,
     117                   dest);
    111118        return false;
    112119    }
     
    127134            return true;
    128135        }
    129         psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
     136        psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
     137                   PS_ERRORTEXT_psLogSetDestination_DEST_LOCATION_INVALID,
     138                   location);
    130139        return 1;
    131140    } else if (strcmp(protocol, "file") == 0) {
     
    133142
    134143        if (file == NULL) {
    135             psError(__func__, "Could not open file '%s' for output.", location);
     144            psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_IO,
     145                       PS_ERRORTEXT_psLogSetDestination_OPEN_FILE_FAILED,
     146                       location);
    136147            return false;
    137148        }
     
    143154    }
    144155
    145     psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
     156    psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
     157               PS_ERRORTEXT_psLogSetDestination_UNSUPPORTED_PROTOCOL,
     158               protocol);
    146159    return false;
    147160}
     
    205218            break;
    206219        default:
    207             psError(__func__, "Unknown logging keyword %c", *ptr);
     220            psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_VALUE,
     221                       PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY, *ptr);
    208222            break;
    209223        }
Note: See TracChangeset for help on using the changeset viewer.