Open Source Tomb Raider Engine
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Log.cpp 435B

123456789101112131415161718192021222324
  1. /*!
  2. * \file src/Log.cpp
  3. * \brief Global Logging Utility
  4. *
  5. * \author xythobuz
  6. */
  7. #include "global.h"
  8. #include "Log.h"
  9. std::vector<LogLevel> Log::logs;
  10. std::vector<LogEntry> Log::wholeLog;
  11. void Log::initialize() {
  12. for (int i = 0; i < LOG_COUNT; i++)
  13. logs.emplace_back(i);
  14. }
  15. LogLevel& Log::get(int level) {
  16. orAssertGreaterThanEqual(level, 0);
  17. orAssertLessThan(level, LOG_COUNT);
  18. return logs.at(level);
  19. }