Skip to content

Commit

Permalink
add note
Browse files Browse the repository at this point in the history
  • Loading branch information
hxf0223 committed Sep 4, 2024
1 parent b0174fe commit 9824974
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 19 deletions.
4 changes: 2 additions & 2 deletions _posts/2024-08-11-atomic.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-08-13-cpp-perf-repos.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-08-13-std-function.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-08-21-intel-tbb-malloc-usage.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-08-23-ubuntu-install-opencv.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion _posts/2024-08-26-density-algrithm-knn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-08-27-c++-range-v3.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-08-27-read-file-using-mmap.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-08-28-intel-tbb-paralle.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-09-02-CRTP-introduce.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 35 additions & 0 deletions _posts/2024-09-04-spdlog-usage.md
Original file line number Diff line number Diff line change
@@ -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 <spdlog/spdlog.h>

#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
```

0 comments on commit 9824974

Please sign in to comment.