mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=1620
This commit is contained in:
parent
a2fc72deb1
commit
1a2a84cdf7
|
@ -10,7 +10,8 @@ void assimilate_handler(
|
|||
{
|
||||
write_log(MSG_NORMAL, "assimilating WU %s\n", wu.name);
|
||||
if (wu.canonical_resultid) {
|
||||
write_log(MSG_NORMAL, "canonical result:\n%s", canonical_result.xml_doc_out);
|
||||
write_log(MSG_NORMAL, "canonical result:\n");
|
||||
write_log_multiline(MSG_NORMAL, canonical_result.xml_doc_out);
|
||||
} else {
|
||||
write_log(MSG_NORMAL, "no canonical result\n");
|
||||
}
|
||||
|
|
|
@ -148,11 +148,13 @@ int main(int argc, char** argv) {
|
|||
|
||||
// Call lock_file after fork(), because file locks are not always inherited
|
||||
if (lock_file(LOCKFILE)) {
|
||||
write_log(MSG_NORMAL, "Another copy of assimilator is already running\n");
|
||||
write_log(MSG_NORMAL, "Not starting; another copy of assimilator is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
write_pid_file(PIDFILE);
|
||||
|
||||
write_log(MSG_NORMAL, "Starting\n");
|
||||
|
||||
retval = boinc_db_open(config.db_name, config.db_passwd);
|
||||
if (retval) {
|
||||
write_log(MSG_CRITICAL, "Can't open DB\n");
|
||||
|
|
|
@ -576,6 +576,7 @@ int main(int argc, char** argv) {
|
|||
write_log(MSG_NORMAL, "Another copy of db_dump is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
write_log(MSG_NORMAL, "Starting\n");
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
|
|
|
@ -236,6 +236,7 @@ int main(int argc, char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
write_pid_file(PIDFILE);
|
||||
write_log(MSG_NORMAL, "Starting\n");
|
||||
|
||||
retval = destroy_shmem(config.shmem_key);
|
||||
if (retval) {
|
||||
|
|
|
@ -154,6 +154,7 @@ int main(int argc, char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
write_pid_file(PIDFILE);
|
||||
write_log(MSG_NORMAL, "Starting\n");
|
||||
|
||||
retval = boinc_db_open(config.db_name, config.db_passwd);
|
||||
if (retval) {
|
||||
|
|
|
@ -236,6 +236,8 @@ int main(int argc, char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
write_pid_file(PIDFILE);
|
||||
write_log(MSG_NORMAL, "Starting\n");
|
||||
|
||||
install_sigint_handler();
|
||||
|
||||
srand48(getpid() + time(0));
|
||||
|
|
|
@ -53,6 +53,38 @@ void write_log(int msg_level, const char* p, ...) {
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
void write_log_line(int msg_level, const char* p, ...) {
|
||||
if (debug_level < msg_level) return;
|
||||
if (p == NULL) return;
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, p);
|
||||
fprintf(stderr, "%s [%s]: ", timestamp(), msg_level_dscription(msg_level));
|
||||
vfprintf(stderr, p, ap);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
// break a multi-line string into lines (so that we show prefix on each line)
|
||||
void write_log_multiline(int msg_level, const char* p) {
|
||||
if (debug_level < msg_level) return;
|
||||
if (p == NULL) return;
|
||||
|
||||
string line;
|
||||
while (*p) {
|
||||
if (*p == '\n') {
|
||||
write_log(msg_level, " %s\n", line.c_str());
|
||||
line.erase();
|
||||
} else {
|
||||
line += *p;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
if (!line.empty()) {
|
||||
write_log(msg_level, " %s\n", line.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void write_pid_file(const char* filename)
|
||||
{
|
||||
FILE* fpid = fopen(filename, "w");
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#define MSG_DEBUG 2
|
||||
|
||||
void write_log(int, char const*, ...);
|
||||
void write_log_multiline(int msg_level, const char* p);
|
||||
extern void write_pid_file(const char* filename);
|
||||
extern void set_debug_level(int);
|
||||
extern void check_stop_trigger();
|
||||
|
|
|
@ -143,6 +143,8 @@ int main(int argc, char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
write_pid_file(PIDFILE);
|
||||
write_log(MSG_NORMAL, "Starting\n");
|
||||
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
|
|
|
@ -290,8 +290,6 @@ int main(int argc, char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
write_log(MSG_NORMAL, "starting validator; min_quorum %d\n", min_quorum);
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
write_log(MSG_CRITICAL, "Can't parse config file\n");
|
||||
|
@ -310,6 +308,8 @@ int main(int argc, char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
write_pid_file(PIDFILE);
|
||||
write_log(MSG_NORMAL, "Starting validator; min_quorum %d\n", min_quorum);
|
||||
|
||||
install_sigint_handler();
|
||||
|
||||
main_loop(one_pass);
|
||||
|
|
Loading…
Reference in New Issue