日志::spdlog
https://github.com/gabime/spdlog git clone https://github.com/gabime/spdlog.git cd spdlog && mkdir build && cd build cmake .. && make -j make install
Installing: /usr/local/include/spdlog
Installing:/usr/local/lib/spdlog/libspdlog.a
或
直接将 include/spdlog 复制到 /usr/local/include 即可。
#include <spdlog/spdlog.h> #include <spdlog/sinks/rotating_file_sink.h> #include "spdlog/sinks/daily_file_sink.h" namespace spd = spdlog;
auto console = spd::daily_logger_mt("console", "./logs/daily_log", 2, 30); console->flush_on(spd::level::debug); spd::get("console")->info("app start... ");