mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
#pragma once
|
||
|
||
#include <string>
|
||
|
||
namespace ServerRuntime
|
||
{
|
||
enum EServerLogLevel
|
||
{
|
||
eServerLogLevel_Debug = 0,
|
||
eServerLogLevel_Info = 1,
|
||
eServerLogLevel_Warn = 2,
|
||
eServerLogLevel_Error = 3
|
||
};
|
||
|
||
/**
|
||
* 文字列をログレベルへ変換する(`debug`/`info`/`warn`/`error`)
|
||
*
|
||
* @param value 変換元文字列
|
||
* @param outLevel 変換結果の出力先
|
||
* @return 変換成功時 `true`
|
||
*/
|
||
bool TryParseServerLogLevel(const char *value, EServerLogLevel *outLevel);
|
||
|
||
void SetServerLogLevel(EServerLogLevel level);
|
||
EServerLogLevel GetServerLogLevel();
|
||
|
||
void LogDebug(const char *category, const char *message);
|
||
void LogInfo(const char *category, const char *message);
|
||
void LogWarn(const char *category, const char *message);
|
||
void LogError(const char *category, const char *message);
|
||
|
||
/** 指定レベル・カテゴリでフォーマットログを出力する */
|
||
void LogDebugf(const char *category, const char *format, ...);
|
||
void LogInfof(const char *category, const char *format, ...);
|
||
void LogWarnf(const char *category, const char *format, ...);
|
||
void LogErrorf(const char *category, const char *format, ...);
|
||
|
||
void LogStartupStep(const char *message);
|
||
void LogWorldIO(const char *message);
|
||
void LogWorldName(const char *prefix, const std::wstring &name);
|
||
}
|