Skip to content

Commit 8a18ec2

Browse files
committed
Bump version to v1.1.2; remove full file path logging option and simplify source location handling
1 parent 88af8a3 commit 8a18ec2

7 files changed

Lines changed: 109 additions & 337 deletions

File tree

.gitignore

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
1-
# Prerequisites
2-
*.d
3-
4-
# Compiled Object files
5-
*.slo
6-
*.lo
7-
*.o
8-
*.obj
9-
10-
# Precompiled Headers
11-
*.gch
12-
*.pch
13-
14-
# Linker files
15-
*.ilk
16-
17-
# Debugger Files
18-
*.pdb
19-
20-
# Compiled Dynamic libraries
21-
*.so
22-
*.dylib
23-
*.dll
24-
25-
# Fortran module files
26-
*.mod
27-
*.smod
28-
29-
# Compiled Static libraries
30-
*.lai
31-
*.la
32-
*.a
33-
*.lib
34-
35-
# Executables
36-
*.exe
37-
*.out
38-
*.app
39-
40-
# debug information files
41-
*.dwo
42-
43-
build/
44-
.vscode/
45-
.claude/
46-
*.log
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Linker files
15+
*.ilk
16+
17+
# Debugger Files
18+
*.pdb
19+
20+
# Compiled Dynamic libraries
21+
*.so
22+
*.dylib
23+
*.dll
24+
25+
# Fortran module files
26+
*.mod
27+
*.smod
28+
29+
# Compiled Static libraries
30+
*.lai
31+
*.la
32+
*.a
33+
*.lib
34+
35+
# Executables
36+
*.exe
37+
*.out
38+
*.app
39+
40+
# debug information files
41+
*.dwo
42+
43+
build/
44+
.vscode/
45+
.claude/
46+
.codex/
47+
.agents/
48+
*.log
4749
benchmark_logs/

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# v1.1.2 - 07-30-2026
2+
- Remove full file path logging option
3+
- `LOG_*` macros and `log_with_location()` now always use the basename; the full-path runtime toggle is gone
4+
- Remove `LogConfig::include_source_location_full_path`
5+
- Remove `Logger::set_source_location_full_path_enabled()` and `Logger::source_location_full_path_enabled()`
6+
- Remove the two-parameter `log_with_location(level, file_path, file_name, line, ...)` overload
7+
- Remove `StaticSourceLocation::file_path` field and the `SLICK_LOGGER_FILE_PATH` macro
8+
- Simplify `StaticSourceLocation` constructor and `static_source_location()` to accept only a file name
9+
110
# v1.1.1 - 07-06-2026
211
- Use compiler-provided `__FILE_NAME__` for `LOG_*` call-site filenames when predefined
312
- Falls back to the internal constexpr basename helper for older GCC/Clang-compatible C++20 compilers and MSVC

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.20)
22

33
project(slick-logger
4-
VERSION 1.1.1
4+
VERSION 1.1.2
55
LANGUAGES CXX)
66

77
set(CMAKE_CXX_STANDARD 20)

README.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ The available levels are `L_TRACE`, `L_DEBUG`, `L_INFO`, `L_WARN`, `L_ERROR`, `L
180180
181181
### Source Location Logging
182182
183-
Source-location logging is enabled by default for `LOG_*` macros. The default output uses only the basename, while full-path output can be enabled at runtime:
183+
Source-location logging is enabled by default for `LOG_*` macros. The output always uses only the basename (e.g. `main.cpp:8`):
184184
185185
```cpp
186186
#include <slick/logger.hpp>
@@ -192,9 +192,6 @@ int main() {
192192
193193
LOG_INFO("uses basename by default"); // [main.cpp:8]
194194
195-
Logger::instance().set_source_location_full_path_enabled(true);
196-
LOG_INFO("uses the full SLICK_LOGGER_FILE_PATH value"); // [C:\repo\app\main.cpp:11]
197-
198195
Logger::instance().set_source_location_enabled(false);
199196
LOG_INFO("source location omitted");
200197
@@ -209,8 +206,7 @@ using namespace slick::logger;
209206

210207
LogConfig config;
211208
config.sinks.push_back(std::make_shared<FileSink>("app.log"));
212-
config.include_source_location = true; // default
213-
config.include_source_location_full_path = false; // default: basename only
209+
config.include_source_location = true; // default
214210

215211
Logger::instance().init(config);
216212
```
@@ -235,30 +231,15 @@ target_compile_definitions(your_app PRIVATE SLICK_LOGGER_ENABLE_SOURCE_LOCATION=
235231
#include <slick/logger.hpp>
236232
```
237233
238-
```cpp
239-
// Override the compile-time source path expression captured by LOG_* macros.
240-
// Full-path runtime output can only show what this macro provides.
241-
#define SLICK_LOGGER_FILE_PATH __FILE__
242-
#include <slick/logger.hpp>
243-
```
244-
245-
For bridge code that receives source information from another logging layer, direct source-location overloads are also available. The `const char*` source path/name passed to these public overloads is copied before the entry is queued, so dynamic strings are safe:
234+
For bridge code that receives source information from another logging layer, a direct source-location overload is also available. The `const char*` path passed is copied before the entry is queued, so dynamic strings are safe, and the basename is extracted automatically:
246235
247236
```cpp
248237
std::string path = "C:\\repo\\app\\bridge.cpp";
249238
slick::logger::Logger::instance().log_with_location(
250239
slick::logger::LogLevel::L_INFO,
251240
path.c_str(),
252241
42,
253-
"bridged message");
254-
255-
std::string basename = "bridge.cpp";
256-
slick::logger::Logger::instance().log_with_location(
257-
slick::logger::LogLevel::L_WARN,
258-
path.c_str(),
259-
basename.c_str(),
260-
43,
261-
"bridged message with precomputed basename");
242+
"bridged message"); // logged as [bridge.cpp:42]
262243
```
263244

264245
Direct sink helpers such as `sink->log_info(...)` route to that sink only and do not automatically attach the caller's source location. Use `LOG_*` macros when you want automatic call-site capture.
@@ -495,7 +476,6 @@ int main() {
495476
config.log_queue_size = 16384;
496477
config.string_buffer_size = 4 * 1024 * 1024;
497478
config.include_source_location = true;
498-
config.include_source_location_full_path = false;
499479

500480
Logger::instance().init(config);
501481

@@ -514,7 +494,6 @@ int main() {
514494
- `log_queue_size`: internal log-entry queue size, rounded up to a power of two
515495
- `string_buffer_size`: internal string-storage queue size, rounded up to a power of two
516496
- `include_source_location`: include file and line for `LOG_*` macro calls, default `true`
517-
- `include_source_location_full_path`: use the full captured path instead of the basename, default `false`
518497

519498
### Lifecycle and Runtime Controls
520499

@@ -525,7 +504,6 @@ Logger::instance().init("app.log", 65536, 4 * 1024 * 1024);
525504

526505
Logger::instance().set_level(LogLevel::L_DEBUG);
527506
Logger::instance().set_source_location_enabled(true);
528-
Logger::instance().set_source_location_full_path_enabled(false);
529507

530508
LOG_INFO("queued asynchronously");
531509

0 commit comments

Comments
 (0)