Optional source location captured for a structured log entry.
More...
#include <src/logging/logger.h>
|
| bool | valid () const |
| | Return whether this source-location payload contains usable data.
|
| |
|
| static constexpr LogSourceLocation | current (const char *currentFile=nullptr, int currentLine=0) noexcept |
| | Capture the current call-site source location when the compiler supports it.
|
| |
|
|
const char * | file = nullptr |
| | Translation-unit file path where the entry originated.
|
| |
|
int | line = 0 |
| | One-based source line number where the entry originated.
|
| |
Optional source location captured for a structured log entry.
◆ current()
| static constexpr LogSourceLocation logging::LogSourceLocation::current |
( |
const char * | currentFile = nullptr, |
|
|
int | currentLine = 0 ) |
|
inlinestaticnodiscardconstexprnoexcept |
Capture the current call-site source location when the compiler supports it.
- Parameters
-
| currentFile | Source file reported by the compiler builtin. |
| currentLine | Source line reported by the compiler builtin. |
- Returns
- A source-location payload for the current call site.
◆ valid()
| bool logging::LogSourceLocation::valid |
( |
| ) |
const |
|
inlinenodiscard |
Return whether this source-location payload contains usable data.
- Returns
- true when both the file path and line number are valid.
The documentation for this struct was generated from the following file: