예제 #1
0
파일: log.cpp 프로젝트: HaustWang/HEnginee
void LogFileBuf::TraverseAndMove() {
#ifndef WINDOWS
    // traverse all file
    System::ForFilesWithinFold(StringExt::GetDirName(_file_prefix),
                               [this](std::string const& file) { RealShift(file); });
#endif
}
예제 #2
0
파일: log.hpp 프로젝트: leoxk/lsf
    bool Shift() {
        // check file exist
        if (!IsOpen()) return false;

        // check need shift
        switch (_shift_type) {
            case SHIFT_DAY:   if (_last_shift_val == (int)lsf::util::Date().GetDay())   return false; break;
            case SHIFT_MONTH: if (_last_shift_val == (int)lsf::util::Date().GetMonth()) return false; break;
            default: return false;
        }

        // real shift
        if (!RealShift(_file_path)) return false;

        // close old file
        _file_buf.close();
        return true;
    }
예제 #3
0
파일: log.cpp 프로젝트: HaustWang/HEnginee
bool LogFileBuf::Shift() {
    // check file exist
    if (!IsOpen()) return false;

    // check need shift
    Time t;
    switch (_shift_type) {
        case SHIFT_DAY:
            if (_last_shift_val == (int)t.GetMday()) return false;
            break;
        case SHIFT_MONTH:
            if (_last_shift_val == (int)t.GetMonth()) return false;
            break;
        default:
            return false;
    }

    // real shift
    if (!RealShift(_file_path)) return false;

    // close old file
    _file_buf.close();
    return true;
}
예제 #4
0
파일: log.hpp 프로젝트: leoxk/lsf
 void TraverseAndMove() {
     // traverse all file
     lsf::util::System::ForFilesWithinFold(
             lsf::util::StringExt::GetDirName(_file_prefix),
             [this] (std::string const& file) { RealShift(file); });
 }