Files
XCSDD/docs/api/debug/logger/removesink.md
ssdfasd 58a83f445a 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
2026-03-19 12:44:08 +08:00

30 lines
756 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Logger::RemoveSink
```cpp
void RemoveSink(ILogSink* sink)
```
从日志系统移除指定的输出目标。通过指针查找并移除对应的 SinkLogger 不再向该目标发送日志。
**参数:**
- `sink` - 要移除的日志输出目标指针
**复杂度:** O(n)n 为注册的 Sink 数量
**示例:**
```cpp
#include <XCEngine/Debug/Logger.h>
auto fileSink = std::make_unique<XCEngine::Debug::FileLogSink>("app.log");
XCEngine::Debug::FileLogSink* rawPtr = fileSink.get();
XCEngine::Debug::Logger::Get().AddSink(std::move(fileSink));
// 稍后移除
XCEngine::Debug::Logger::Get().RemoveSink(rawPtr);
```
## 相关文档
- [Logger 总览](logger.md) - 返回类总览
- [ILogSink](../ilogsink/ilogsink.md) - 日志输出接口