Changeset 4951 for trunk/psLib/test/sys/tst_psLogMsg.c
- Timestamp:
- Sep 6, 2005, 2:15:51 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sys/tst_psLogMsg.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tst_psLogMsg.c
r4547 r4951 7 7 #include "pslib_strict.h" 8 8 #include "psTest.h" 9 #include <unistd.h> 10 #include <fcntl.h> 9 11 10 12 static psS32 testLogMsg00(); … … 176 178 { 177 179 psS32 i = 0; 178 FILE* file; 179 char line[256]; 180 // FILE* file; 181 int fd; 182 // char line[256]; 180 183 181 184 printf("--------------- psLogSetDestination(PS_LOG_NONE) ----------------\n"); 182 psLogSetDestination("none"); 185 // psLogSetDestination("none"); 186 psLogSetDestination(0); 183 187 for (i=0;i<10;i++) { 184 188 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); … … 186 190 187 191 printf("------------- psLogSetDestination(PS_LOG_TO_STDERR) -------------\n"); 188 psLogSetDestination("dest:stderr"); 192 // psLogSetDestination("dest:stderr"); 193 psLogSetDestination(2); 189 194 for (i=0;i<10;i++) { 190 195 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); … … 192 197 193 198 printf("------------- psLogSetDestination(PS_LOG_TO_STDOUT) -------------\n"); 194 psLogSetDestination("dest:stdout"); 195 for (i=0;i<10;i++) { 196 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); 197 } 199 // psLogSetDestination("dest:stdout"); 200 psLogSetDestination(1); 201 for (i=0;i<10;i++) { 202 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); 203 } 204 198 205 printf("--------------- psLogSetDestination(""file:log.txt"") ---------------\n"); 199 psLogSetDestination("file:log.txt"); 200 for (i=0;i<10;i++) { 201 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); 202 } 203 204 psLogSetDestination("none"); 206 fd = creat("log.txt", 0666); 207 // psLogSetDestination("file:log.txt"); 208 psLogSetDestination(fd); 209 for (i=0;i<10;i++) { 210 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); 211 } 212 213 214 // psLogSetDestination("none"); 215 FILE *file; 216 char line[257]; 217 // psLogSetDestination(-1); 218 psLogSetDestination(0); 205 219 printf("--------------------- The Contents of log.txt -------------------\n"); 206 220 file = fopen("log.txt","r"); … … 209 223 } 210 224 fclose(file); 211 225 close(fd); 226 227 int fd2 = creat("/eva/log.txt", 0666); 212 228 printf("--------------- psLogSetDestination(""file:/eva/log.txt"") ----------\n"); 213 psLogSetDestination("file:/eva/log.txt"); 229 // psLogSetDestination("file:/eva/log.txt"); 230 psLogSetDestination(fd2); 214 231 for ( i=0;i<10;i++) { 215 232 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); 216 233 } 217 218 return 0; 219 } 234 close(fd2); 235 236 return 0; 237 }
Note:
See TracChangeset
for help on using the changeset viewer.
