You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-26Lines changed: 4 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,7 @@ The available levels are `L_TRACE`, `L_DEBUG`, `L_INFO`, `L_WARN`, `L_ERROR`, `L
180
180
181
181
### Source Location Logging
182
182
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`):
184
184
185
185
```cpp
186
186
#include <slick/logger.hpp>
@@ -192,9 +192,6 @@ int main() {
192
192
193
193
LOG_INFO("uses basename by default"); // [main.cpp:8]
// 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 `constchar*` 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:
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() {
495
476
config.log_queue_size = 16384;
496
477
config.string_buffer_size = 4 * 1024 * 1024;
497
478
config.include_source_location = true;
498
-
config.include_source_location_full_path = false;
499
479
500
480
Logger::instance().init(config);
501
481
@@ -514,7 +494,6 @@ int main() {
514
494
-`log_queue_size`: internal log-entry queue size, rounded up to a power of two
515
495
-`string_buffer_size`: internal string-storage queue size, rounded up to a power of two
516
496
-`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`
0 commit comments