//
// Created by Lenn on 2025/10/23.
//


#include "dlog.hh"

spdlog::level::level_enum DLog::level_ = spdlog::level::info;

void DLog::set_level(DLogLevel level) {
    printf("SetLevel log_level:%d\n", level);
    fflush(stdout);
    switch (level)
    {
    case DLogLevel::TRACE:
        level_ = spdlog::level::trace;
        break;
    case DLogLevel::DEBUG:
        level_ = spdlog::level::debug;
        break;
    case DLogLevel::INFO:
        level_ = spdlog::level::info;
        break;
    case DLogLevel::WARN:
        level_ = spdlog::level::warn;
        break;
    case DLogLevel::ERR:
        level_ = spdlog::level::err;
        break;
    case DLogLevel::CRITICAL:
        level_ = spdlog::level::critical;
        break;
    case DLogLevel::OFF:
        level_ = spdlog::level::off;
        break;
    default:
        level_ = spdlog::level::trace;
        break;
    }
}