#include "gtest/gtest.h"
#include "KMLogger.h"
#include <sstream>
#include <iostream>

class KMLoggerTest : public ::testing::Test
{
protected:
    void SetUp() override
    {
        // 重置日志等级为最低，保证所有日志级别都输出
        kmlogger.setLogLevel(KMLogLevel::trace);
    }
};

// 测试日志等级设置（枚举）
TEST_F(KMLoggerTest, SetLogLevelEnum)
{
    kmlogger.setLogLevel(KMLogLevel::debug);
    kmlogger.debugLog("debug msg");
    SUCCEED();
}

// 测试日志等级设置（字符串）
TEST_F(KMLoggerTest, SetLogLevelString)
{
    kmlogger.setLogLevel("info");
    kmlogger.infoLog("info message");
    kmlogger.warnLog("warn message");
    SUCCEED();
}
