#include <toast/log/rotation_policies.hpp>
The number of logs to keep is configurable via the max_rotated() method. The initial value of max_rotated is 2. The max_rotated value is the total number of ROTATED logs to keep (which does NOT include the currently active, base log). For example, a max_rotated value of 5 will allow for the active log, and a zero-based, sequentially suffixed set up to ".4".
Note: If you want a single log file, you must either use a compile-time non-rotation policy, or set your check policy to be infinite (if applicable). Attempting to use a max_rotated value which is less than 2 will make you very unhappy.
Public Member Functions | |
void | max_rotated (unsigned int logs) |
Protected Member Functions | |
const char * | rotate (const char *f) |
Protected Attributes | |
unsigned int | max_rotated_ |
const char* toast::log::roll_rotation::rotate | ( | const char * | f | ) | [inline, protected] |
Special case the zero element to keep the algorithm clean ..
In a way, we are special casing the max_rotated - 1 element as well by setting the initial test_suffix to it, which means that it will get tested first every time here ..