IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2011, 10:45:16 AM (15 years ago)
Author:
eugene
Message:

psKernelAlloc now reports file & line; fix bug in psKernelTruncate; limit leak dump to 500 leaks; cleanup log formats (indent by depth, split lines with function name); add test samples for psImageCovariance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psLogMsg.c

    r28404 r30595  
    291291        head_ptr += strlen(head_ptr);
    292292    }
    293     // Hostname should be 20 characters.
     293
     294    // Hostname should be 10 characters.
    294295    if (logHost) {
    295296        if (head_ptr > head) {
    296297            *head_ptr++ = '|';
    297298        }
    298         maxLength -= snprintf(head_ptr, maxLength, "%-20s", hostname);
     299        maxLength -= snprintf(head_ptr, maxLength, " %s ", hostname);
    299300        head_ptr += strlen(head_ptr);
    300301    }
     
    310311            *head_ptr++ = '|';
    311312        }
    312         maxLength -= snprintf(head_ptr, maxLength, "%s", name);
     313        maxLength -= snprintf(head_ptr, maxLength, "%s|\n", name);
    313314
    314315        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
    320324        return;
    321325    }
     
    332336        char *line = strtok_r(msg, "\n", &msgPtr);
    333337        while (line) {
    334             if(write(logFD, "    ", 4)) {;} // ignore return value
     338            if(write(logFD, "          ", PS_MIN(2*level, 10))) {;} // ignore return value
    335339            if(write(logFD, line, strlen(line))) {;} // ignore return value
    336340            if(write(logFD, "\n", 1)) {;} // ignore return value
Note: See TracChangeset for help on using the changeset viewer.