Fix debug module documentation structure
- Create overview page for FileLogSink (filelogsink/filelogsink.md) - Create constructor page for FileLogSink (filelogsink/construct.md) - Create overview page for ConsoleLogSink (consolelogsink/overview.md) - Fix self-referencing links in FileLogSink and ConsoleLogSink constructor pages The constructor pages were incorrectly linking to themselves as 'overview' pages. Created proper overview pages that list all public methods and link to their individual documentation pages.
This commit is contained in:
@@ -17,4 +17,5 @@ XCEngine::Debug::Logger::Get().AddSink(std::move(sink));
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [ConsoleLogSink 总览](consolelogsink.md) - 返回类总览
|
||||
- [ConsoleLogSink 总览](overview.md) - 返回类总览
|
||||
- [Debug 模块总览](../debug.md) - 返回模块总览
|
||||
|
||||
41
docs/api/debug/consolelogsink/overview.md
Normal file
41
docs/api/debug/consolelogsink/overview.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# ConsoleLogSink
|
||||
|
||||
**命名空间**: `XCEngine::Debug`
|
||||
|
||||
**类型**: `class`
|
||||
|
||||
**头文件**: `XCEngine/Debug/ConsoleLogSink.h`
|
||||
|
||||
**描述**: 控制台日志输出目标,将日志输出到标准输出流。
|
||||
|
||||
## 概述
|
||||
|
||||
`ConsoleLogSink` 是日志系统的控制台输出实现。它将日志条目输出到标准输出流(stdout),支持彩色输出和日志级别过滤。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| `ConsoleLogSink()` | [构造函数](consolelogsink.md) |
|
||||
| `~ConsoleLogSink()` | [析构函数](~consolelogsink.md) |
|
||||
| `void Log(const LogEntry& entry)` | [输出日志到控制台](log.md) |
|
||||
| `void Flush()` | [刷新输出流](flush.md) |
|
||||
| `void SetColorOutput(bool enable)` | [设置彩色输出](setcoloroutput.md) |
|
||||
| `void SetMinimumLevel(LogLevel level)` | [设置最小日志级别](setminimumlevel.md) |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Debug/ConsoleLogSink.h>
|
||||
|
||||
auto sink = std::make_unique<XCEngine::Debug::ConsoleLogSink>();
|
||||
sink->SetColorOutput(true);
|
||||
sink->SetMinimumLevel(XCEngine::Debug::LogLevel::Warning);
|
||||
XCEngine::Debug::Logger::Get().AddSink(std::move(sink));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Debug 模块总览](../debug.md) - 返回模块总览
|
||||
- [Logger](../logger/logger.md) - 日志记录器
|
||||
- [ILogSink](../ilogsink/ilogsink.md) - 日志输出接口
|
||||
24
docs/api/debug/filelogsink/construct.md
Normal file
24
docs/api/debug/filelogsink/construct.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# FileLogSink::FileLogSink
|
||||
|
||||
```cpp
|
||||
FileLogSink(const Containers::String& filePath)
|
||||
```
|
||||
|
||||
构造函数,打开指定路径的文件用于日志写入。如果文件已存在,则追加写入;如果不存在,则创建新文件。
|
||||
|
||||
**参数:**
|
||||
- `filePath` - 日志文件路径
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
auto fileSink = std::make_unique<XCEngine::Debug::FileLogSink>("logs/engine.log");
|
||||
XCEngine::Debug::Logger::Get().AddSink(std::move(fileSink));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [FileLogSink 总览](filelogsink.md) - 返回类总览
|
||||
- [Debug 模块总览](../debug.md) - 返回模块总览
|
||||
@@ -1,23 +1,37 @@
|
||||
# FileLogSink::FileLogSink
|
||||
# FileLogSink
|
||||
|
||||
**命名空间**: `XCEngine::Debug`
|
||||
|
||||
**类型**: `class`
|
||||
|
||||
**头文件**: `XCEngine/Debug/FileLogSink.h`
|
||||
|
||||
**描述**: 文件日志输出目标,将日志写入到指定文件。
|
||||
|
||||
## 概述
|
||||
|
||||
`FileLogSink` 是日志系统的文件输出实现。它将日志条目写入到指定的文件,支持追加写入模式。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| `FileLogSink(const Containers::String& filePath)` | [构造函数](construct.md) |
|
||||
| `~FileLogSink()` | [析构函数](~filelogsink.md) |
|
||||
| `void Log(const LogEntry& entry)` | [输出日志到文件](log.md) |
|
||||
| `void Flush()` | [刷新缓冲区](flush.md) |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
FileLogSink(const Containers::String& filePath)
|
||||
```
|
||||
#include <XCEngine/Debug/FileLogSink.h>
|
||||
|
||||
构造函数,打开指定路径的文件用于日志写入。如果文件已存在,则追加写入;如果不存在,则创建新文件。
|
||||
|
||||
**参数:**
|
||||
- `filePath` - 日志文件路径
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
auto fileSink = std::make_unique<XCEngine::Debug::FileLogSink>("logs/engine.log");
|
||||
auto fileSink = std::make_unique<XCEngine::Debug::FileLogSink>("logs/app.log");
|
||||
XCEngine::Debug::Logger::Get().AddSink(std::move(fileSink));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [FileLogSink 总览](filelogsink.md) - 返回类总览
|
||||
- [Debug 模块总览](../debug.md) - 返回模块总览
|
||||
- [Logger](../logger/logger.md) - 日志记录器
|
||||
- [ILogSink](../ilogsink/ilogsink.md) - 日志输出接口
|
||||
|
||||
Reference in New Issue
Block a user