Added /log rotate option

This commit is contained in:
James Booth
2014-04-13 20:41:11 +01:00
parent bc6f8ceb3a
commit a4a23fdf68
7 changed files with 58 additions and 15 deletions

View File

@@ -154,9 +154,11 @@ log_msg(log_level_t level, const char * const area, const char * const msg)
fflush(logp);
g_free(date_fmt);
result = ftell(logp);
if (result != -1 && result >= prefs_get_max_log_size()) {
_rotate_log_file();
if (prefs_get_boolean(PREF_LOG_ROTATE)) {
result = ftell(logp);
if (result != -1 && result >= prefs_get_max_log_size()) {
_rotate_log_file();
}
}
}
}