Ticket #848: log-associate-project.diff

File log-associate-project.diff, 9.2 KB (added by Nicolas, 15 years ago)
  • client/app_start.cpp

     
    372372    bool high_priority = (app_version->avg_ncpus < 1);
    373373
    374374    if (first_time && log_flags.task) {
    375         msg_printf(result->project, MSG_INFO,
     375        msg_printf(wup->project, MSG_INFO,
    376376            "Starting %s", result->name
    377377        );
    378378    }
    379379    if (log_flags.cpu_sched) {
    380         msg_printf(result->project, MSG_INFO,
     380        msg_printf(wup->project, MSG_INFO,
    381381            "[cpu_sched] Starting %s%s", result->name, first_time?" (initial)":"(resume)"
    382382        );
    383383    }
     
    548548            if (!pCEB(&environment_block, sandbox_account_service_token, FALSE)) {
    549549                if (log_flags.task) {
    550550                    windows_error_string(error_msg, sizeof(error_msg));
    551                     msg_printf(result->project, MSG_INFO,
     551                    msg_printf(wup->project, MSG_INFO,
    552552                        "Process environment block creation failed: %s", error_msg
    553553                    );
    554554                }
     
    579579            if (!pDEB(environment_block)) {
    580580                if (log_flags.task) {
    581581                    windows_error_string(error_msg, sizeof(error_msg2));
    582                     msg_printf(result->project, MSG_INFO,
     582                    msg_printf(wup->project, MSG_INFO,
    583583                        "Process environment block cleanup failed: %s",
    584584                        error_msg2
    585585                    );
     
    681681    chdir(current_dir);
    682682
    683683    if (log_flags.task_debug) {
    684         msg_printf(0, MSG_INFO,
     684        msg_printf(wup->project, MSG_INFO,
    685685            "[task_debug] ACTIVE_TASK::start(): forked process: pid %d\n", pid
    686686        );
    687687    }
     
    848848    }
    849849
    850850    if (log_flags.task_debug) {
    851         msg_printf(0, MSG_INFO,
     851        msg_printf(wup->project, MSG_INFO,
    852852            "[task_debug] ACTIVE_TASK::start(): forked process: pid %d\n", pid
    853853        );
    854854    }
  • client/app_graphics.cpp

     
    7373    }
    7474
    7575    if (log_flags.scrsave_debug) {
    76         msg_printf(0, MSG_INFO,
     76        msg_printf(wup->project, MSG_INFO,
    7777            "[scrsave_debug] ACTIVE_TASK::request_graphics_mode(): requesting graphics mode %s for %s",
    7878            xml_graphics_modes[m.mode], result->name
    7979        );
     
    102102    if (app_client_shm.shm->graphics_reply.get_msg(buf)) {
    103103        app_client_shm.decode_graphics_msg(buf, gm);
    104104        if (log_flags.scrsave_debug) {
    105             msg_printf(0, MSG_INFO,
     105            msg_printf(wup->project, MSG_INFO,
    106106                "[scrsave_debug] ACTIVE_TASK::check_graphics_mode_ack(): got graphics ack %s for %s, previous mode %s",
    107107                buf, result->name, xml_graphics_modes[graphics_mode_acked]
    108108            );
  • client/file_xfer.cpp

     
    203203        }
    204204        iter++;
    205205    }
    206     msg_printf(NULL, MSG_INTERNAL_ERROR,
     206    msg_printf(fxp->fip->project, MSG_INTERNAL_ERROR,
    207207        "File transfer for %s not found", fxp->fip->name
    208208    );
    209209    return ERR_NOT_FOUND;
  • client/cs_account.cpp

     
    253253            delete project;
    254254        } else {
    255255            if (lookup_project(project->master_url)) {
    256                 msg_printf(NULL, MSG_INFO,
     256                msg_printf(project, MSG_INFO,
    257257                    "Duplicate account file %s - ignoring", name.c_str()
    258258                );
    259259                delete project;
  • client/cs_scheduler.cpp

     
    802802    //
    803803    for (i=0; i<sr.result_acks.size(); i++) {
    804804        if (log_flags.sched_op_debug) {
    805             msg_printf(0, MSG_INFO,
     805            msg_printf(project, MSG_INFO,
    806806                "[sched_op_debug] handle_scheduler_reply(): got ack for result %s\n",
    807807                sr.result_acks[i].name
    808808            );
     
    896896
    897897    set_client_state_dirty("handle_scheduler_reply");
    898898    if (log_flags.state_debug) {
    899         msg_printf(0, MSG_INFO,
     899        msg_printf(project, MSG_INFO,
    900900            "[state_debug] handle_scheduler_reply(): State after handle_scheduler_reply():"
    901901        );
    902902        print_summary();
  • client/scheduler_op.cpp

     
    814814            continue;
    815815        } else if (strlen(buf)>1){
    816816            if (log_flags.unparsed_xml) {
    817                 msg_printf(0, MSG_INFO,
     817                msg_printf(project, MSG_INFO,
    818818                    "[unparsed_xml] SCHEDULER_REPLY::parse(): unrecognized %s\n", buf
    819819                );
    820820            }
  • client/app_control.cpp

     
    448448                //
    449449                if (atp->process_control_queue.timeout(180)) {
    450450            if (log_flags.task_debug) {
    451                 msg_printf(NULL, MSG_INFO,
     451                msg_printf(atp->result->project, MSG_INFO,
    452452                    "Restarting %s - message timeout", atp->result->name
    453453                );
    454454            }
     
    482482        } else {
    483483            if (log_flags.task_debug) {
    484484                char errmsg[1024];
    485                 msg_printf(0, MSG_INFO,
     485                msg_printf(atp->result->project, MSG_INFO,
    486486                    "[task_debug] task %s GetExitCodeProcess() failed - %s GLE %d (0x%x)",
    487487                    atp->result->name,
    488488                    windows_format_error_string(
     
    508508            // is probably a benchmark process; don't show error
    509509            //
    510510            if (!gstate.are_cpu_benchmarks_running() && log_flags.task_debug) {
    511                 msg_printf(NULL, MSG_INTERNAL_ERROR, "Process %d not found\n", pid);
     511                msg_printf(atp->wup->project, MSG_INTERNAL_ERROR, "Process %d not found\n", pid);
    512512            }
    513513            return false;
    514514        }
     
    528528
    529529    retval = current_disk_usage(disk_usage);
    530530    if (retval) {
    531         msg_printf(0, MSG_INTERNAL_ERROR,
     531        msg_printf(this->wup->project, MSG_INTERNAL_ERROR,
    532532            "Can't get task disk usage: %s", boincerror(retval)
    533533        );
    534534    } else {
     
    925925        return false;
    926926    }
    927927    if (log_flags.app_msg_receive) {
    928         msg_printf(NULL, MSG_INFO,
     928        msg_printf(this->wup->project, MSG_INFO,
    929929            "[app_msg_receive] got msg from slot %d: %s", slot, msg_buf
    930930        );
    931931    }
  • client/app.cpp

     
    239239        {
    240240            retval = detach_shmem(app_client_shm.shm);
    241241            if (retval) {
    242                 msg_printf(NULL, MSG_INTERNAL_ERROR,
     242                msg_printf(wup->project, MSG_INTERNAL_ERROR,
    243243                    "Couldn't detach shared memory: %s", boincerror(retval)
    244244                );
    245245            }
    246246            retval = destroy_shmem(shmem_seg_name);
    247247            if (retval) {
    248                 msg_printf(NULL, MSG_INTERNAL_ERROR,
     248                msg_printf(wup->project, MSG_INTERNAL_ERROR,
    249249                    "Couldn't destroy shared memory: %s", boincerror(retval)
    250250                );
    251251            }
     
    313313    retval = procinfo_setup(piv);
    314314        if (retval) {
    315315                if (log_flags.mem_usage_debug) {
    316                         msg_printf(0, MSG_INTERNAL_ERROR,
     316                        msg_printf(NULL, MSG_INTERNAL_ERROR,
    317317                                "[mem_usage_debug] procinfo_setup() returned %d", retval
    318318                        );
    319319                }
     
    689689        else if (parse_double(buf, "<current_cpu_time>", x)) continue;
    690690        else {
    691691            if (log_flags.unparsed_xml) {
    692                 msg_printf(0, MSG_INFO,
     692                msg_printf(project, MSG_INFO,
    693693                    "[unparsed_xml] ACTIVE_TASK::parse(): unrecognized %s\n", buf
    694694                );
    695695            }
     
    753753            else delete atp;
    754754        } else {
    755755            if (log_flags.unparsed_xml) {
    756                 msg_printf(0, MSG_INFO,
     756                msg_printf(NULL, MSG_INFO,
    757757                    "[unparsed_xml] ACTIVE_TASK_SET::parse(): unrecognized %s\n", buf
    758758                );
    759759            }
     
    881881                    fip->status = FILE_PRESENT;
    882882                }
    883883            } else {
    884                 msg_printf(0, MSG_INTERNAL_ERROR, "Can't find uploadable file %s", p);
     884                msg_printf(wup->project, MSG_INTERNAL_ERROR, "Can't find uploadable file %s", p);
    885885            }
    886886            sprintf(path, "%s/%s", slot_dir, buf);
    887887            delete_project_owned_file(path, true);  // delete the link file