Example #1
0
void
test_single_thread(int count) 
{
    Log::createIt(logSink); 
    test_log(*Log::it(), count);

    std::time_t time = std::time(0);
    time += 3600*24;
    logSink->rotate(time);
    test_log(*Log::it(), count);

    time += 3600*24;
    logSink->rotate(time);
    test_log(*Log::it(), count);

    Log::destroyIt();
}
Example #2
0
void
test_multi_thread()
{
    boost::thread thr1(mt_test_proc);
#   if 1
    boost::thread thr2(mt_test_proc);
    boost::thread thr3(mt_test_proc);
    boost::thread thr4(mt_test_proc);
    boost::thread thr5(mt_test_proc);
    
    sleep(4);
    std::time_t time = std::time(0);
    time += 3600*24;
    logSink->rotate(time);
    
    thr5.join();
    thr4.join();
    thr3.join();
    thr2.join();
#   endif
    thr1.join();
}