fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
27
docs/api/debug/logger/addsink.md
Normal file
27
docs/api/debug/logger/addsink.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Logger::AddSink
|
||||
|
||||
```cpp
|
||||
void AddSink(std::unique_ptr<ILogSink> sink)
|
||||
```
|
||||
|
||||
向日志系统添加一个输出目标(Sink)。Logger 持有 Sink 的所有权,传入的 `unique_ptr` 被移动到内部容器中。每次日志记录时,所有已注册的 Sink 的 `Log` 方法都会被调用。
|
||||
|
||||
**参数:**
|
||||
- `sink` - 要添加的日志输出目标,使用 `std::unique_ptr` 包装
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Debug/Logger.h>
|
||||
|
||||
XCEngine::Debug::Logger::Get().Initialize();
|
||||
XCEngine::Debug::Logger::Get().AddSink(std::make_unique<XCEngine::Debug::ConsoleLogSink>());
|
||||
XCEngine::Debug::Logger::Get().AddSink(std::make_unique<XCEngine::Debug::FileLogSink>("app.log"));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Logger 总览](logger.md) - 返回类总览
|
||||
- [ILogSink](../ilogsink/ilogsink.md) - 日志输出接口
|
||||
Reference in New Issue
Block a user