RSTools 3.1.0
Versatile C++20 utility library
Loading...
Searching...
No Matches
SourceLocation.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace RST::Log {
4
7 const char* file = nullptr;
8 const char* func = nullptr;
9 int line = 0;
10
11 [[nodiscard]] constexpr bool valid() const noexcept { return file != nullptr; }
12 };
13
14}
15
17#define RST_SOURCE_LOCATION ::RST::Log::SourceLocation{__FILE__, __func__, __LINE__}
Thread-safe logging: loggers, sinks, patterns and macros.
Definition Terminal.hpp:8
File, function and line of a log call.
Definition SourceLocation.hpp:6
const char * func
Definition SourceLocation.hpp:8
int line
Definition SourceLocation.hpp:9
constexpr bool valid() const noexcept
Definition SourceLocation.hpp:11
const char * file
Definition SourceLocation.hpp:7