IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10460


Ignore:
Timestamp:
Dec 4, 2006, 4:31:24 PM (20 years ago)
Author:
magnier
Message:

changes trace/log components to psModules.config from func

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfig.c

    r10447 r10460  
    44 *  @author EAM (IfA)
    55 *
    6  *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2006-12-04 22:21:28 $
     6 *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2006-12-05 02:31:24 $
    88 *
    99 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    148148    // find the first existing entry in the path (starting with the bare name)
    149149    realName = psStringCopy (name);
    150     psTrace (__func__, 5, "trying %s\n", realName);
     150    psTrace ("psModules.config", 5, "trying %s\n", realName);
    151151
    152152    int status = stat (realName, &filestat);
     
    169169        realName = psStringCopy (configPath->data[i]);
    170170        psStringAppend (&realName, "/%s", name);
    171         psTrace (__func__, 5, "trying %s\n", realName);
     171        psTrace ("psModules.config", 5, "trying %s\n", realName);
    172172
    173173        status = stat (realName, &filestat);
     
    234234        psArgumentRemove(argNum, config->argc, config->argv);
    235235        if (argNum >= *config->argc) {
    236             psLogMsg(__func__, PS_LOG_WARN,
     236            psLogMsg("psModules.config", PS_LOG_WARN,
    237237                     "-site command-line switch provided without the required filename --- ignored.\n");
    238238        } else {
     
    308308            psArgumentRemove(argNum, config->argc, config->argv);
    309309            if (argNum >= *config->argc) {
    310                 psLogMsg(__func__, PS_LOG_WARN, "-log command-line switch provided without the "
     310                psLogMsg("psModules.config", PS_LOG_WARN, "-log command-line switch provided without the "
    311311                         "required log destination --- ignored.\n");
    312312            } else {
    313313                if (!psLogSetDestination(psMessageDestination(config->argv[argNum]))) {
    314                     psLogMsg(__func__, PS_LOG_WARN, "Unable to set log destination to %s\n",
     314                    psLogMsg("psModules.config", PS_LOG_WARN, "Unable to set log destination to %s\n",
    315315                             config->argv[argNum]);
    316316                }
     
    325325                // expanded in the future to do files, and perhaps even sockets.
    326326                if (!psLogSetDestination(psMessageDestination(logDest))) {
    327                     psLogMsg(__func__, PS_LOG_WARN, "Unable to set log destination to %s\n",
     327                    psLogMsg("psModules.config", PS_LOG_WARN, "Unable to set log destination to %s\n",
    328328                             config->argv[argNum]);
    329329                }
     
    339339            while ((traceItem = psMetadataGetAndIncrement(traceIter))) {
    340340                if (traceItem->type != PS_DATA_S32) {
    341                     psLogMsg(__func__, PS_LOG_WARN,
     341                    psLogMsg("psModules.config", PS_LOG_WARN,
    342342                             "The level for trace component %s is not of type S32 (%x)\n",
    343343                             traceItem->name, traceItem->type);
     
    368368            // expanded in the future to do files, and perhaps even sockets.
    369369            if (!psTraceSetDestination(psMessageDestination(traceDest))) {
    370                 psLogMsg(__func__, PS_LOG_WARN, "Unable to set trace destination to %s\n", traceDest);
     370                psLogMsg("psModules.config", PS_LOG_WARN, "Unable to set trace destination to %s\n", traceDest);
    371371
    372372            }
     
    417417        psArgumentRemove(argNum, config->argc, config->argv);
    418418        if (argNum >= *config->argc) {
    419             psLogMsg(__func__, PS_LOG_WARN,
     419            psLogMsg("psModules.config", PS_LOG_WARN,
    420420                     "-camera command-line switch provided without the required camera or filename --- "
    421421                     "ignored.\n");
     
    524524    psMetadata *formats = psMetadataLookupMetadata(&mdok, camera, "FORMATS"); // List of formats
    525525    if (!mdok || !formats) {
    526         psLogMsg(__func__, PS_LOG_WARN, "Unable to find list of FORMATS in camera %s --- ignored\n",
     526        psLogMsg("psModules.config", PS_LOG_WARN, "Unable to find list of FORMATS in camera %s --- ignored\n",
    527527                 cameraName);
    528528        return false;
     
    533533    while ((formatsItem = psMetadataGetAndIncrement(formatsIter))) {
    534534        if (formatsItem->type != PS_DATA_STRING) {
    535             psLogMsg(__func__, PS_LOG_WARN, "In camera %s, camera format %s is not of type STR --- "
     535            psLogMsg("psModules.config", PS_LOG_WARN, "In camera %s, camera format %s is not of type STR --- "
    536536                     "ignored.\n", cameraName, formatsItem->name);
    537537            continue;
     
    540540        psMetadata *testFormat = NULL;  // Format to test against what we've got
    541541        if (!pmConfigFileRead(&testFormat, formatsItem->data.V, formatsItem->name)) {
    542             psLogMsg(__func__, PS_LOG_WARN, "Trouble reading reading camera format %s --- ignored.\n",
     542            psLogMsg("psModules.config", PS_LOG_WARN, "Trouble reading reading camera format %s --- ignored.\n",
    543543                     formatsItem->name);
    544544            psFree(testFormat);
     
    548548        if (pmConfigValidateCameraFormat(testFormat, header)) {
    549549            if (!*format) {
    550                 psLogMsg(__func__, PS_LOG_INFO, "Camera %s, format %s matches header.\n", cameraName,
     550                psLogMsg("psModules.config", PS_LOG_INFO, "Camera %s, format %s matches header.\n", cameraName,
    551551                         formatsItem->name);
    552552                *format = psMemIncrRefCounter(testFormat);
    553553                result = true;
    554554            } else {
    555                 psLogMsg(__func__, PS_LOG_WARN, "Camera %s, format %s also matches header --- ignored.\n",
     555                psLogMsg("psModules.config", PS_LOG_WARN, "Camera %s, format %s also matches header --- ignored.\n",
    556556                         cameraName, formatsItem->name);
     557            }
     558        } else {
     559            if (psTraceGetLevel ("psModules.config") >= PS_LOG_INFO) {
     560                psErrorStackPrint (stderr, "Camera %s, format %s does not match\n", cameraName, formatsItem->name);
    557561            }
    558562        }
     
    589593                    camerasItem->comment);
    590594            if (camerasItem->type != PS_DATA_STRING) {
    591                 psLogMsg(__func__, PS_LOG_WARN, "Camera configuration for %s in CAMERAS is not of type STR "
     595                psLogMsg("psModules.config", PS_LOG_WARN, "Camera configuration for %s in CAMERAS is not of type STR "
    592596                         "--- ignored.\n", camerasItem->name);
    593597                continue;
     
    598602
    599603            if (!pmConfigFileRead(&testCamera, camerasItem->data.V, camerasItem->name)) {
    600                 psLogMsg(__func__, PS_LOG_WARN, "Trouble reading reading camera configuration %s --- "
     604                psLogMsg("psModules.config", PS_LOG_WARN, "Trouble reading reading camera configuration %s --- "
    601605                         "ignored.\n", camerasItem->name);
    602606                psFree(testCamera);
     
    653657
    654658    if (!pmConfigFileRead(&camera, cameraPath, cameraName)) {
    655         psLogMsg(__func__, PS_LOG_WARN, "Trouble reading reading camera configuration %s", cameraName);
     659        psLogMsg("psModules.config", PS_LOG_WARN, "Trouble reading reading camera configuration %s", cameraName);
    656660        psFree(camera);
    657661        return NULL;
     
    687691    }
    688692    if (!(mdStatus01 && mdStatus02 && mdStatus03 && mdStatus04)) {
    689         psLogMsg(__func__, PS_LOG_WARN,
     693        psLogMsg("psModules.config", PS_LOG_WARN,
    690694                 "Could not determine database server, name, user, and password from site metadata.\n");
    691695        return NULL;
Note: See TracChangeset for help on using the changeset viewer.