mirror of https://github.com/BOINC/boinc.git
- CC: Move time_stats file creatio logic so that it is
created during gstate.init() instead of at class creation time. This way time_stats.log ends up in the data directory. client/ client_state.C time_stats.C, .h svn path=/trunk/boinc/; revision=14342
This commit is contained in:
parent
3bc88f376b
commit
6d6a802634
|
@ -12029,3 +12029,13 @@ Rom 2 Dec 2007
|
|||
win_build/installerv2/redist/Windows/x64/
|
||||
boinccas.dll
|
||||
boinccas95.dll
|
||||
|
||||
Rom 2 Dec 2007
|
||||
- CC: Move time_stats file creatio logic so that it is
|
||||
created during gstate.init() instead of at class
|
||||
creation time. This way time_stats.log ends up in
|
||||
the data directory.
|
||||
|
||||
client/
|
||||
client_state.C
|
||||
time_stats.C, .h
|
||||
|
|
|
@ -166,6 +166,7 @@ int CLIENT_STATE::init() {
|
|||
scheduler_op->url_random = drand();
|
||||
|
||||
detect_platforms();
|
||||
time_stats.start();
|
||||
|
||||
msg_printf(
|
||||
NULL, MSG_INFO, "Starting BOINC client version %d.%d.%d for %s%s",
|
||||
|
|
|
@ -65,10 +65,7 @@ TIME_STATS::TIME_STATS() {
|
|||
previous_connected_state = CONNECTED_STATE_UNINITIALIZED;
|
||||
inactive_start = 0;
|
||||
trim_stats_log();
|
||||
time_stats_log = fopen(TIME_STATS_LOG, "a");
|
||||
if (time_stats_log) {
|
||||
setbuf(time_stats_log, 0);
|
||||
}
|
||||
time_stats_log = NULL;
|
||||
}
|
||||
|
||||
// if log file is over a meg, discard everything older than a year
|
||||
|
@ -276,6 +273,13 @@ int TIME_STATS::parse(MIOFILE& in) {
|
|||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
||||
void TIME_STATS::start() {
|
||||
time_stats_log = fopen(TIME_STATS_LOG, "a");
|
||||
if (time_stats_log) {
|
||||
setbuf(time_stats_log, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void TIME_STATS::quit() {
|
||||
log_append("power_off", gstate.now);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
void log_append_net(int);
|
||||
void trim_stats_log();
|
||||
void get_log_after(double, MIOFILE&);
|
||||
void start();
|
||||
void quit();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue