From 982497474ff352b79c2f78b93fd412d89a85b466 Mon Sep 17 00:00:00 2001 From: hxf0223 Date: Wed, 4 Sep 2024 13:48:10 +0800 Subject: [PATCH] add note --- _posts/2024-08-11-atomic.md | 4 +-- _posts/2024-08-13-cpp-perf-repos.md | 4 +-- _posts/2024-08-13-std-function.md | 4 +-- _posts/2024-08-21-intel-tbb-malloc-usage.md | 4 +-- _posts/2024-08-23-ubuntu-install-opencv.md | 4 +-- _posts/2024-08-26-density-algrithm-knn.md | 2 +- _posts/2024-08-27-c++-range-v3.md | 4 +-- _posts/2024-08-27-read-file-using-mmap.md | 4 +-- _posts/2024-08-28-intel-tbb-paralle.md | 4 +-- _posts/2024-09-02-CRTP-introduce.md | 4 +-- _posts/2024-09-04-spdlog-usage.md | 35 +++++++++++++++++++++ 11 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 _posts/2024-09-04-spdlog-usage.md diff --git a/_posts/2024-08-11-atomic.md b/_posts/2024-08-11-atomic.md index 0bb15b5..fe940d5 100644 --- a/_posts/2024-08-11-atomic.md +++ b/_posts/2024-08-11-atomic.md @@ -1,8 +1,8 @@ --- title: 整理:内存模型 (OnGoing) date: 2024-08-11 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++, cpu, linux] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp, cpu, linux] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-13-cpp-perf-repos.md b/_posts/2024-08-13-cpp-perf-repos.md index d1cb4b4..c4e8bc0 100644 --- a/_posts/2024-08-13-cpp-perf-repos.md +++ b/_posts/2024-08-13-cpp-perf-repos.md @@ -1,8 +1,8 @@ --- title: 总结:内存访问优化 date: 2024-08-27 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++, perf] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp, perf] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-13-std-function.md b/_posts/2024-08-13-std-function.md index 00ecc82..65daebc 100644 --- a/_posts/2024-08-13-std-function.md +++ b/_posts/2024-08-13-std-function.md @@ -1,8 +1,8 @@ --- title: 复习:std::function 用法笔记 date: 2024-08-13 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-21-intel-tbb-malloc-usage.md b/_posts/2024-08-21-intel-tbb-malloc-usage.md index cfdd287..015bc03 100644 --- a/_posts/2024-08-21-intel-tbb-malloc-usage.md +++ b/_posts/2024-08-21-intel-tbb-malloc-usage.md @@ -1,8 +1,8 @@ --- title: Intel TBB malloc 使用 (windows) date: 2024-08-13 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++, perf] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp, perf] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-23-ubuntu-install-opencv.md b/_posts/2024-08-23-ubuntu-install-opencv.md index c4cd456..4595e10 100644 --- a/_posts/2024-08-23-ubuntu-install-opencv.md +++ b/_posts/2024-08-23-ubuntu-install-opencv.md @@ -1,8 +1,8 @@ --- title: Ubuntu 安装 OpenCV date: 2024-08-23 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++, opencv] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp, opencv] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-26-density-algrithm-knn.md b/_posts/2024-08-26-density-algrithm-knn.md index d7e41d2..32ab8ef 100644 --- a/_posts/2024-08-26-density-algrithm-knn.md +++ b/_posts/2024-08-26-density-algrithm-knn.md @@ -2,7 +2,7 @@ title: 聚类算法(密度):基于 nano-flann date: 2024-08-26 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 categories: [algorithm] -tags: [algorithm, c++] # TAG names should always be lowercase +tags: [algorithm, cpp] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-27-c++-range-v3.md b/_posts/2024-08-27-c++-range-v3.md index 46e9571..b80c710 100644 --- a/_posts/2024-08-27-c++-range-v3.md +++ b/_posts/2024-08-27-c++-range-v3.md @@ -1,8 +1,8 @@ --- title: Range-v3 资料 date: 2024-08-27 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-27-read-file-using-mmap.md b/_posts/2024-08-27-read-file-using-mmap.md index 9b0f94d..521be81 100644 --- a/_posts/2024-08-27-read-file-using-mmap.md +++ b/_posts/2024-08-27-read-file-using-mmap.md @@ -1,8 +1,8 @@ --- title: 使用 mmap 读取文件 date: 2024-08-27 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++, perf] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp, perf] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-08-28-intel-tbb-paralle.md b/_posts/2024-08-28-intel-tbb-paralle.md index 318250b..1dd89e6 100644 --- a/_posts/2024-08-28-intel-tbb-paralle.md +++ b/_posts/2024-08-28-intel-tbb-paralle.md @@ -1,8 +1,8 @@ --- title: Intel TBB 并行计算 date: 2024-08-28 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++, perf] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp, perf] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-09-02-CRTP-introduce.md b/_posts/2024-09-02-CRTP-introduce.md index 61e41ca..885c1b9 100644 --- a/_posts/2024-09-02-CRTP-introduce.md +++ b/_posts/2024-09-02-CRTP-introduce.md @@ -1,8 +1,8 @@ --- title: CRTP:使用笔记 date: 2024-09-02 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 -categories: [c++] -tags: [c++, template] # TAG names should always be lowercase +categories: [cpp] +tags: [cpp, template] # TAG names should always be lowercase # 以下默认false math: true diff --git a/_posts/2024-09-04-spdlog-usage.md b/_posts/2024-09-04-spdlog-usage.md new file mode 100644 index 0000000..06f7702 --- /dev/null +++ b/_posts/2024-09-04-spdlog-usage.md @@ -0,0 +1,35 @@ +--- +title: spdlog 使用 +date: 2024-09-04 +0800 # 2022-01-01 13:14:15 +0800 只写日期也行;不写秒也行;这样也行 2022-03-09T00:55:42+08:00 +categories: [cpp] +tags: [cpp] # TAG names should always be lowercase + +# 以下默认false +math: true +mermaid: true +# pin: true +--- + +## 使用时的编译选项 + +```cmake +if(CMAKE_BUILD_TYPE STREQUAL "Release") + add_compile_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_WARN) + add_compile_definitions(-DNDEBUG) +else() + add_compile_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE) +endif() +``` + +## 日志级别,日志格式 + +```c++ +#include + +#ifdef NDEBUG + spdlog::set_level(spdlog::level::warn); // disable spdlog for performance test +#else + spdlog::set_level(spdlog::level::info); + spdlog::set_pattern("%H:%M:%S.%e %t %s %! %v"); +#endif +```