Source code location information for log messages.
More...
#include <log.hpp>
|
| consteval | Location (const char *str_file=__builtin_FILE(), uint32_t str_line=__builtin_LINE()) |
| | Constructs a Location with automatic file/line capture.
|
| |
| constexpr auto | get () const |
| | Formats location as "filename::line".
|
| |
|
| std::string_view | m_str_file |
| | Source file name (basename only)
|
| |
| uint32_t | m_line |
| | Source line number.
|
| |
Source code location information for log messages.
Automatically captures file name and line number at compile time using __builtin_FILE() and __builtin_LINE(). The file path is trimmed to show only the filename (no directory path).
- Examples
- /flatimage/src/std/expected.hpp.
Definition at line 402 of file log.hpp.
◆ Location()
| ns_log::Location::Location |
( |
const char * | str_file = __builtin_FILE(), |
|
|
uint32_t | str_line = __builtin_LINE() ) |
|
inlineconsteval |
Constructs a Location with automatic file/line capture.
- Parameters
-
| str_file | Source file path (default: current file via __builtin_FILE()) |
| str_line | Source line number (default: current line via __builtin_LINE()) |
Definition at line 413 of file log.hpp.
◆ get()
| auto ns_log::Location::get |
( |
| ) |
const |
|
inlineconstexpr |
Formats location as "filename::line".
- Returns
- std::string Formatted location string
Definition at line 425 of file log.hpp.
◆ m_line
| uint32_t ns_log::Location::m_line |
Source line number.
Definition at line 405 of file log.hpp.
◆ m_str_file
| std::string_view ns_log::Location::m_str_file |
Source file name (basename only)
Definition at line 404 of file log.hpp.
The documentation for this struct was generated from the following file: