Function flush

Summary

#include <src/easylogging++.h>

(1) void flush(void)

(2) void flush(Level level, base::type::fstream_t *fs)

Function overload

Synopsis

#include <src/easylogging++.h>

void flush(void)

Description

Flushes logger to sync all log files for all levels.

Mentioned in

Source

Lines 680-688 in src/easylogging++.cc. Line 2261 in src/easylogging++.h.

void Logger::flush(void) {
  ELPP_INTERNAL_INFO(3, "Flushing logger [" << m_id << "] all levels");
  base::threading::ScopedLock scopedLock(lock());
  base::type::EnumType lIndex = LevelHelper::kMinValid;
  LevelHelper::forEachLevel(&lIndex, [&](void) -> bool {
    flush(LevelHelper::castFromInt(lIndex), nullptr);
    return false;
  });
}

Synopsis

#include <src/easylogging++.h>

void flush(Level level, base::type::fstream_t *fs)

Description

No description yet.

Mentioned in

Source

Lines 690-702 in src/easylogging++.cc. Line 2263 in src/easylogging++.h.

void Logger::flush(Level level, base::type::fstream_t* fs) {
  if (fs == nullptr && m_typedConfigurations->toFile(level)) {
    fs = m_typedConfigurations->fileStream(level);
  }
  if (fs != nullptr) {
    fs->flush();
    std::unordered_map<Level, unsigned int>::iterator iter = m_unflushedCount.find(level);
    if (iter != m_unflushedCount.end()) {
      iter->second = 0;
    }
    Helpers::validateFileRolling(this, level);
  }
}





Add Discussion

Log in to comment