载入中...
搜索中...
未找到
CrashLog.h 文件参考

Persistent, thread-safe record of engine crash and problem events. 更多...

#include "common/Export.h"
#include <string>

浏览源代码.

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 

函数

void eve::initSystemLogging (const std::string &logDir={})
 Opens (append) the crash/error log file and records a session marker.
 
void eve::recordLogEvent (const std::string &level, const std::string &message)
 Appends a timestamped event line to the crash/error log.
 
void eve::recordCrashEvent (const std::string &report)
 Records a crash report, safe to call from a crash/exception handler.
 
void eve::recordSessionStart ()
 Appends a session-start marker.
 
void eve::recordSessionEnd (int exitCode)
 Appends the session-end marker carrying the process exit code.
 
std::string eve::crashLogPath ()
 Path of the open crash/error log file.
 

变量

constexpr const char * eve::kSessionStartMarker = "EVEngine session start"
 Marker text that opens a session block in eve.log.
 
constexpr const char * eve::kSessionEndMarker = "session end (exit code"
 Marker text that closes a session block (followed by the exit code). @ownership Borrowed pointer to a static string literal; the caller owns nothing. @lifetime Static storage duration; valid for the whole process.
 

详细描述

Persistent, thread-safe record of engine crash and problem events.

Unlike zeroerr's structured logging (which the engine only uses for ASSERTs), this facility writes a plain append-only eve.log file that survives process death. It is intentionally self-contained (std::ofstream) so crash/error events are captured regardless of where or how the failure occurs, and it works on every platform (not just Windows).

Typical wiring:

  • src/engine/main.cpp calls initSystemLogging() very early in main().
  • The Windows unhandled-exception filter (CrashHandler.h) reports hard crashes via recordCrashEvent().
  • The top-level run() catch blocks report exceptions via recordLogEvent().

The log location defaults to eve.log in the current working directory and can be overridden with the EVE_LOG_DIR environment variable or an explicit initSystemLogging(dir) argument.

在文件 CrashLog.h 中定义.