38 lines
718 B
Markdown
38 lines
718 B
Markdown
# Logger::RemoveSink
|
||
|
||
```cpp
|
||
void RemoveSink(ILogSink* sink);
|
||
```
|
||
|
||
从 Logger 移除指定的日志输出槽。
|
||
|
||
**参数:**
|
||
- `sink` - 指向要移除的 ILogSink 接口的指针
|
||
|
||
**返回:** 无
|
||
|
||
**线程安全:** ✅
|
||
|
||
**复杂度:** O(n),n 为注册的 Sink 数量
|
||
|
||
**示例:**
|
||
|
||
```cpp
|
||
#include "XCEngine/Debug/Logger.h"
|
||
#include "XCEngine/Debug/ConsoleLogSink.h"
|
||
|
||
using namespace XCEngine::Debug;
|
||
|
||
Logger& logger = Logger::Get();
|
||
auto consoleSink = std::make_unique<ConsoleLogSink>();
|
||
logger.AddSink(consoleSink);
|
||
|
||
// 移除 Sink(传入原始指针)
|
||
logger.RemoveSink(consoleSink.get());
|
||
```
|
||
|
||
## 相关文档
|
||
|
||
- [Logger](logger.md) - 返回类总览
|
||
- [AddSink](addsink.md) - 添加日志输出槽
|