5 Star 40 Fork 18

Gitee 极速下载/ZenShot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/easysoft/zenshot
克隆/下载
spdlogwrapper.cpp 997 Bytes
一键复制 编辑 原始数据 按行查看 历史
leexu007 提交于 2022-07-15 16:13 . + trayIcon
#include "spdlogwrapper.hpp"
#include "spdlog/spdlog.h"
#include "spdlog/cfg/env.h" // support for loading levels from the environment variable
#include "spdlog/fmt/ostr.h" // support for user defined types
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
namespace spdlog
{
static logger* logger_;
void spdlog_init(const char* name, const char* file_name, int h, int m, int lv, int flv)
{
auto console_sink = std::make_shared<sinks::stdout_color_sink_mt>();
console_sink->set_level(static_cast<level::level_enum>(lv));
auto file_sink = std::make_shared<sinks::daily_file_sink_mt>(file_name, h, m);
file_sink->set_level(static_cast<level::level_enum>(lv));
logger_ = new logger(name, {console_sink, file_sink});
logger_->set_level(static_cast<level::level_enum>(lv));
logger_->flush_on(static_cast<level::level_enum>(flv));
set_pattern("[%H:%M:%S %z] [thread %t] %v");
}
logger* logger_ptr()
{
return logger_;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/ZenShot.git
git@gitee.com:mirrors/ZenShot.git
mirrors
ZenShot
ZenShot
main

搜索帮助