docs: rebuild Debug API content
This commit is contained in:
@@ -1,32 +1,45 @@
|
||||
# Logger::Error
|
||||
|
||||
公开方法,详见头文件声明。
|
||||
以 `Error` 级别记录一条日志。
|
||||
|
||||
```cpp
|
||||
void Error(LogCategory category, const Containers::String& message);
|
||||
```
|
||||
|
||||
该方法声明于 `XCEngine/Debug/Logger.h`,当前页面用于固定 `Logger` 类目录下的方法级 canonical 路径。
|
||||
## 行为说明
|
||||
|
||||
**参数:**
|
||||
- `category` - 参数语义详见头文件声明。
|
||||
- `message` - 参数语义详见头文件声明。
|
||||
|
||||
**返回:** `void` - 无返回值。
|
||||
|
||||
**示例:**
|
||||
这是 `Logger::Log` 的便捷封装,等价于:
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Debug/Logger.h>
|
||||
Log(LogLevel::Error, category, message);
|
||||
```
|
||||
|
||||
void Example() {
|
||||
XCEngine::Debug::Logger object;
|
||||
// 根据上下文补齐参数后调用 Logger::Error(...)。
|
||||
(void)object;
|
||||
}
|
||||
当前实现只记录错误,不会抛异常或改变控制流。
|
||||
|
||||
## 参数
|
||||
|
||||
- `category` - 日志分类。
|
||||
- `message` - 错误文本。
|
||||
|
||||
## 返回值
|
||||
|
||||
- 无。
|
||||
|
||||
## 线程语义
|
||||
|
||||
- 与 [Log](Log.md) 相同。
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
XCEngine::Debug::Logger::Get().Error(
|
||||
XCEngine::Debug::LogCategory::FileSystem,
|
||||
"Failed to open asset file"
|
||||
);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类总览](Logger.md)
|
||||
- [返回模块目录](../Debug.md)
|
||||
- [返回类型总览](Logger.md)
|
||||
- [Log](Log.md)
|
||||
- [Fatal](Fatal.md)
|
||||
|
||||
Reference in New Issue
Block a user