void LogFileBuf::TraverseAndMove() { #ifndef WINDOWS // traverse all file System::ForFilesWithinFold(StringExt::GetDirName(_file_prefix), [this](std::string const& file) { RealShift(file); }); #endif }
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; }
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; }
void TraverseAndMove() { // traverse all file lsf::util::System::ForFilesWithinFold( lsf::util::StringExt::GetDirName(_file_prefix), [this] (std::string const& file) { RealShift(file); }); }