IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30082


Ignore:
Timestamp:
Dec 17, 2010, 9:11:47 AM (15 years ago)
Author:
eugene
Message:

a bit clearer log msg formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psLib/src/sys/psLogMsg.c

    r28404 r30082  
    310310            *head_ptr++ = '|';
    311311        }
    312         maxLength -= snprintf(head_ptr, maxLength, "%s", name);
     312        maxLength -= snprintf(head_ptr, maxLength, "%s\n", name);
    313313
    314314        head_ptr += strlen(head_ptr);
    315315    }
    316 
    317316    if (head_ptr > head) {
    318         *head_ptr++ = '\n';
    319     } else if (!logMsg) {                  // no output desired
     317        *head_ptr++ = '|';
     318    }
     319
     320    // XXX rather than putting in a return for the message, let's only put in the return if we asked for the function name
     321    if ((head_ptr == head) && !logMsg) { // no output desired
    320322        return;
    321323    }
     
    332334        char *line = strtok_r(msg, "\n", &msgPtr);
    333335        while (line) {
    334             if(write(logFD, "    ", 4)) {;} // ignore return value
     336            if(write(logFD, "          ", PS_MIN(level, 10))) {;} // ignore return value
    335337            if(write(logFD, line, strlen(line))) {;} // ignore return value
    336338            if(write(logFD, "\n", 1)) {;} // ignore return value
Note: See TracChangeset for help on using the changeset viewer.