Changeset 30595 for trunk/psLib/src/sys/psLogMsg.c
- Timestamp:
- Feb 13, 2011, 10:45:16 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psLogMsg.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psLogMsg.c
r28404 r30595 291 291 head_ptr += strlen(head_ptr); 292 292 } 293 // Hostname should be 20 characters. 293 294 // Hostname should be 10 characters. 294 295 if (logHost) { 295 296 if (head_ptr > head) { 296 297 *head_ptr++ = '|'; 297 298 } 298 maxLength -= snprintf(head_ptr, maxLength, " %-20s", hostname);299 maxLength -= snprintf(head_ptr, maxLength, " %s ", hostname); 299 300 head_ptr += strlen(head_ptr); 300 301 } … … 310 311 *head_ptr++ = '|'; 311 312 } 312 maxLength -= snprintf(head_ptr, maxLength, "%s ", name);313 maxLength -= snprintf(head_ptr, maxLength, "%s|\n", name); 313 314 314 315 head_ptr += strlen(head_ptr); 315 } 316 317 if (head_ptr > head) { 318 *head_ptr++ = '\n'; 319 } else if (!logMsg) { // no output desired 316 } else { 317 if (head_ptr > head) { 318 *head_ptr++ = '|'; 319 } 320 } 321 322 // rather than putting in a return for the message, let's only put in the return if we asked for the function name 323 if ((head_ptr == head) && !logMsg) { // no output desired 320 324 return; 321 325 } … … 332 336 char *line = strtok_r(msg, "\n", &msgPtr); 333 337 while (line) { 334 if(write(logFD, " ", 4)) {;} // ignore return value338 if(write(logFD, " ", PS_MIN(2*level, 10))) {;} // ignore return value 335 339 if(write(logFD, line, strlen(line))) {;} // ignore return value 336 340 if(write(logFD, "\n", 1)) {;} // ignore return value
Note:
See TracChangeset
for help on using the changeset viewer.
