boothj5/profanity — pull request #73 by pasis (2012-11-11 22:02:18+00:00)
Title: introduce initial log rotate support

This patch adds initial support for log rotation. Log file is rotated when its size exceeds prefs_get_max_log_size(). So rotated log file may be bigger than this value. For tests this function always reuturns PREFS_MAX_LOG_SIZE macro from preferences.h.
Rotation means renaming profanity.log to profanity.log.1 with saving the last copy. This is the way logrotate program works.

TODO:
* Command like /log maxsize can be implemented.
* Also maxsize should be stored in config file.
* maxsize must be bigger then strlen("Log has been rotated")+2