Changeset 7576 for trunk/psModules/src/config/pmConfig.c
- Timestamp:
- Jun 14, 2006, 4:24:19 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfig.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfig.c
r7528 r7576 3 3 * @author PAP, IfA 4 4 * 5 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-06-1 3 02:39:27$5 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-06-15 02:24:19 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 258 258 "-camera command-line switch provided without the required filename --- ignored.\n"); 259 259 } else { 260 readConfig(&config->camera, argv[argNum], "camera"); 260 261 psArgumentRemove(argNum, argc, argv); 261 readConfig(&config->camera, argv[argNum], "camera");262 262 } 263 263 } … … 310 310 311 311 312 // 313 // If LOGDEST is specified in the configuration file, then we must initialize 314 // with a call to psLogSetDestination(). 315 // XXX: This is not spec'ed in the SDRS. 316 // 317 psString logDest = psMetadataLookupStr(&mdok, config->site, "LOGDEST"); 318 if (mdok && logDest) { 319 // XXX: Only stdout and stderr are provided for now; this section should be 320 // expanded in the future to do files, and perhaps even sockets. 321 int logFD = STDIN_FILENO; // a known invalid value 322 if (!strcasecmp(logDest, "STDOUT")) { 323 logFD = STDOUT_FILENO; 324 } 325 if (!strcasecmp(logDest, "STDERR")) { 326 logFD = STDERR_FILENO; 327 } 328 if (logFD == STDIN_FILENO) { 329 psLogMsg(__func__, PS_LOG_WARN, "Only STDERR and STDOUT currently supported as a log " 330 "destination.\n"); 331 logFD = STDERR_FILENO; 332 } 333 psTrace(__func__, 7, "Setting log destination to STDOUT.\n"); 334 psLogSetDestination(logFD); 312 argNum = psArgumentGet(*argc, argv, "-log"); 313 if (argNum > 0) { 314 psArgumentRemove(argNum, argc, argv); 315 if (argNum >= *argc) { 316 psLogMsg(__func__, PS_LOG_WARN, 317 "-log command-line switch provided without the required log destination --- ignored.\n"); 318 } else { 319 if (!psLogSetDestination(psMessageDestination(argv[argNum]))) { 320 psLogMsg(__func__, PS_LOG_WARN, "Unable to set log destination to %s\n", argv[argNum]); 321 } 322 psArgumentRemove(argNum, argc, argv); 323 } 324 } else { 325 // 326 // If LOGDEST is specified in the configuration file, then we must initialize 327 // with a call to psLogSetDestination(). 328 // XXX: This is not spec'ed in the SDRS. 329 // 330 psString logDest = psMetadataLookupStr(&mdok, config->site, "LOGDEST"); 331 if (mdok && logDest && strlen(logDest) > 0) { 332 // XXX: Only stdout and stderr are provided for now; this section should be 333 // expanded in the future to do files, and perhaps even sockets. 334 if (!!psLogSetDestination(psMessageDestination(argv[argNum]))) { 335 psLogMsg(__func__, PS_LOG_WARN, "Unable to set log destination to %s\n", argv[argNum]); 336 } 337 } 335 338 } 336 339
Note:
See TracChangeset
for help on using the changeset viewer.
