Files
XCSDD/docs/api/debug/consolelogsink/overview.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

42 lines
1.3 KiB
Markdown
Raw 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.
# 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) - 日志输出接口