基础能力--统一日志打印
<p>[TOC]</p>
<table>
<thead>
<tr>
<th>作者</th>
<th>范丽民(969618)</th>
</tr>
</thead>
<tbody>
<tr>
<td>更新日期</td>
<td>2024-7-23</td>
</tr>
<tr>
<td>版本</td>
<td>V1.0.0</td>
</tr>
</tbody>
</table>
<h1>组件说明</h1>
<p>将内置的Log进行封装,方便统一日志处理
屏幕显示关闭日志可以在控制台输入以下命令:
Lab ShowDebugScreen 1 开启,Lab ShowDebugScreen 0 关闭
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=439185c89b5022cd7074213e5b037897&amp;file=file.png" alt="" />
也可以代码中调用SetShowScreen 控制</p>
<h1>组件用法</h1>
<p>```C++
FDebugger::Debug(TEXT(字符串),参数...);
FDebugger::Log(TEXT(字符串),参数...);
FDebugger::Warning(TEXT(字符串),参数...);
FDebugger::Error(TEXT(字符串),参数...);</p>
<pre><code># 组件接口
```C++
//输出Debug日志
template &lt;typename FmtType, typename... Types&gt;
static void Debug(const FmtType&amp; DebugMessage, Types... Args)
//输出Log日志
template &lt;typename FmtType, typename... Types&gt;
static void Log(const FmtType&amp; DebugMessage, Types... Args)
//输出Warning日志
template &lt;typename FmtType, typename... Types&gt;
static void Warning(const FmtType&amp; DebugMessage, Types... Args)
//输出Error日志
template &lt;typename FmtType, typename... Types&gt;
static void Error(const FmtType&amp; DebugMessage, Types... Args)
//设置是否显示屏幕日志
static void SetShowScreen(bool bShow)
//设置日志显示级别
static void SetDebugLevel(EDebugLevel eLevel)
</code></pre>
<h1>组件示例</h1>
<p>```c++</p>
<h1>include "Debuger/FDebugger.h"</h1>
<p>//输出日志信息
FDebugger::Log(TEXT("Hello %s! You have %d new messages."),TEXT("Log"), 2);
FDebugger::Warning(TEXT("Hello %s!"),TEXT("Warning"));
FDebugger::Error(TEXT("Hello Error"));
//设置屏幕显示日志
FDebugger::SetShowScreen(true);
//设置日志输出级别
FDebugger::SetDebugLevel(EDebugLevel::Warning);</p>
<pre><code>```shell
#命令行开启屏幕日志显示
Lab ShowDebugScreen 1
#命令行关闭屏幕日志显示
Lab ShowDebugScreen 0 </code></pre>