MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / logError

Function logError

Examples/NoModules/Appendix A/ExA_03/ExA_03.cpp:7–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <format>
6
7void logError(std::string_view message,
8 std::source_location location = std::source_location::current())
9{
10 std::cerr << std::format("{}:{}:{} - An unexpected error occurred in {}: {}",
11 location.file_name(), location.line(), location.column(),
12 location.function_name(), message) << std::endl;
13}
14
15int main()
16{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected