Bitcoin Core 30.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
SourceLocation Class Reference

Like std::source_location, but allowing to override the function name. More...

#include <logging.h>

Public Member Functions

 SourceLocation (const char *func, std::source_location loc=std::source_location::current())
 The func argument must be constructed from the C++11 func macro. More...
 
std::string_view file_name () const
 
std::uint_least32_t line () const
 
std::string_view function_name_short () const
 

Private Attributes

std::string_view m_func
 
std::source_location m_loc
 

Detailed Description

Like std::source_location, but allowing to override the function name.

Definition at line 41 of file logging.h.

Constructor & Destructor Documentation

◆ SourceLocation()

SourceLocation::SourceLocation ( const char *  func,
std::source_location  loc = std::source_location::current() 
)
inline

The func argument must be constructed from the C++11 func macro.

Ref: https://en.cppreference.com/w/cpp/language/function.html#func Non-static string literals are not supported.

Definition at line 47 of file logging.h.

Member Function Documentation

◆ file_name()

std::string_view SourceLocation::file_name ( ) const
inline

Definition at line 51 of file logging.h.

Here is the caller graph for this function:

◆ function_name_short()

std::string_view SourceLocation::function_name_short ( ) const
inline

Definition at line 53 of file logging.h.

Here is the caller graph for this function:

◆ line()

std::uint_least32_t SourceLocation::line ( ) const
inline

Definition at line 52 of file logging.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_func

std::string_view SourceLocation::m_func
private

Definition at line 56 of file logging.h.

◆ m_loc

std::source_location SourceLocation::m_loc
private

Definition at line 57 of file logging.h.


The documentation for this class was generated from the following file: