Changeset 7587
- Timestamp:
- Jun 16, 2006, 1:01:10 PM (20 years ago)
- Location:
- trunk/psLib
- Files:
-
- 5 edited
-
src/sys/psLogMsg.c (modified) (3 diffs)
-
src/sys/psLogMsg.h (modified) (3 diffs)
-
test/sys/tst_psLogMsg.c (modified) (3 diffs)
-
test/sys/verified/tst_psLogMsg.stderr (modified) (1 diff)
-
test/sys/verified/tst_psLogMsg.stdout (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psLogMsg.c
r7569 r7587 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-06-1 5 00:17:32$13 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-16 23:01:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 186 186 // Special destinations: stdout, stderr 187 187 if (strcmp(dest, "stdout") == 0) { 188 logFD = STDOUT_FILENO; 188 189 return STDOUT_FILENO; 189 190 } 190 191 if (strcmp(dest, "stderr") == 0) { 192 logFD = STDERR_FILENO; 191 193 return STDERR_FILENO; 192 194 } … … 213 215 } 214 216 psFree(protocolLocation); 217 logFD = fileD; 215 218 return fileD; 216 219 } -
trunk/psLib/src/sys/psLogMsg.h
r5072 r7587 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $14 * @date $Date: 200 5-09-20 02:43:53$13 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-16 23:01:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 28 28 /** This procedure sets the destination for future log messages. 29 * This procedure will take a character string as an 30 * argument which can specify general log destinations. 29 * 30 * This procedure will take an integer as an argument 31 * which can specify general log destinations. 31 32 * 32 33 * @return bool true if set successfully, otherwise false. … … 76 77 /** This procedures uses a string to set the destination for which to send 77 78 * the corresponding log messages. 78 *79 79 * 80 80 * @return int: The file descriptor location of the message. -
trunk/psLib/test/sys/tst_psLogMsg.c
r5072 r7587 234 234 close(fd); 235 235 236 int fd2 = creat(" /eva/log.txt", 0666);237 printf("--------------- psLogSetDestination(""file: /eva/log.txt"") ----------\n");236 int fd2 = creat("eva/log.txt", 0666); 237 printf("--------------- psLogSetDestination(""file:eva/log.txt"") ----------\n"); 238 238 // psLogSetDestination("file:/eva/log.txt"); 239 239 psLogSetDestination(fd2); … … 261 261 262 262 printf("------------- psMessageDestination(PS_LOG_TO_STDERR) -------------\n"); 263 psMessageDestination(" dest:stderr");263 psMessageDestination("stderr"); 264 264 // psLogSetDestination(2); 265 265 for (i=0;i<10;i++) { 266 psLogMsg(__func__, i, "Hello World! My level is %d \n", i);266 psLogMsg(__func__, i, "Hello World! My level is %d - stderr\n", i); 267 267 } 268 268 269 269 printf("------------- psMessageDestination(PS_LOG_TO_STDOUT) -------------\n"); 270 psMessageDestination(" dest:stdout");270 psMessageDestination("stdout"); 271 271 // psLogSetDestination(1); 272 272 for (i=0;i<10;i++) { 273 psLogMsg(__func__, i, "Hello World! My level is %d \n", i);273 psLogMsg(__func__, i, "Hello World! My level is %d - stdout\n", i); 274 274 } 275 275 … … 296 296 close(fd); 297 297 298 int fd2 = creat(" /eva/log2.txt", 0666);299 printf("--------------- psMessageDestination(""file: /eva/log.txt"") ----------\n");300 psMessageDestination("file: /eva/log2.txt");298 int fd2 = creat("eva/log2.txt", 0666); 299 printf("--------------- psMessageDestination(""file:eva/log.txt"") ----------\n"); 300 psMessageDestination("file:eva/log2.txt"); 301 301 // psLogSetDestination(fd2); 302 302 for ( i=0;i<10;i++) { -
trunk/psLib/test/sys/verified/tst_psLogMsg.stderr
r7348 r7587 200 200 Hello World! My level is 3 201 201 <DATE><TIME>|<HOST>|A|testLogMsg06 202 Hello World! My level is 0 202 Hello World! My level is 0 - stderr 203 203 <DATE><TIME>|<HOST>|E|testLogMsg06 204 Hello World! My level is 1 204 Hello World! My level is 1 - stderr 205 205 <DATE><TIME>|<HOST>|W|testLogMsg06 206 Hello World! My level is 2 206 Hello World! My level is 2 - stderr 207 207 <DATE><TIME>|<HOST>|I|testLogMsg06 208 Hello World! My level is 3 209 <DATE><TIME>|<HOST>|A|testLogMsg06 210 Hello World! My level is 0 211 <DATE><TIME>|<HOST>|E|testLogMsg06 212 Hello World! My level is 1 213 <DATE><TIME>|<HOST>|W|testLogMsg06 214 Hello World! My level is 2 215 <DATE><TIME>|<HOST>|I|testLogMsg06 216 Hello World! My level is 3 208 Hello World! My level is 3 - stderr 217 209 218 210 ---> TESTPOINT PASSED (psLogMsg{psMessageDestination()} | tst_psLogMsg.c) -
trunk/psLib/test/sys/verified/tst_psLogMsg.stdout
r5072 r7587 1 <DATE><TIME>|<HOST>|A|testLogMsg05 2 Hello World! My level is 0 1 3 --------------- psLogSetDestination(PS_LOG_NONE) ---------------- 2 4 File Descriptor = 0 … … 5 7 ------------- psLogSetDestination(PS_LOG_TO_STDOUT) ------------- 6 8 File Descriptor = 1 7 <DATE><TIME>|<HOST>|A|testLogMsg058 Hello World! My level is 09 9 <DATE><TIME>|<HOST>|E|testLogMsg05 10 10 Hello World! My level is 1 … … 24 24 <DATE><TIME>|<HOST>|I|testLogMsg05 25 25 Hello World! My level is 3 26 --------------- psLogSetDestination(file:/eva/log.txt) ---------- 26 --------------- psLogSetDestination(file:eva/log.txt) ---------- 27 <DATE><TIME>|<HOST>|A|testLogMsg06 28 Hello World! My level is 0 - stdout 27 29 --------------- psMessageDestination(PS_LOG_NONE) ---------------- 28 30 ------------- psMessageDestination(PS_LOG_TO_STDERR) ------------- 29 31 ------------- psMessageDestination(PS_LOG_TO_STDOUT) ------------- 30 <DATE><TIME>|<HOST>|A|testLogMsg0631 Hello World! My level is 032 32 <DATE><TIME>|<HOST>|E|testLogMsg06 33 Hello World! My level is 1 33 Hello World! My level is 1 - stdout 34 34 <DATE><TIME>|<HOST>|W|testLogMsg06 35 Hello World! My level is 2 35 Hello World! My level is 2 - stdout 36 36 <DATE><TIME>|<HOST>|I|testLogMsg06 37 Hello World! My level is 3 37 Hello World! My level is 3 - stdout 38 38 --------------- psMessageDestination(file:log2.txt) --------------- 39 39 --------------------- The Contents of log2.txt ------------------- … … 46 46 <DATE><TIME>|<HOST>|I|testLogMsg06 47 47 Hello World! My level is 3 48 --------------- psMessageDestination(file: /eva/log.txt) ----------48 --------------- psMessageDestination(file:eva/log.txt) ----------
Note:
See TracChangeset
for help on using the changeset viewer.
