Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 512 Bytes

File metadata and controls

20 lines (16 loc) · 512 Bytes

Source Location

Represents specific information about source code, such as line and column numbers, file and function names.

void Log(string_view message, const source_location& location = source_location::current())
{
  clog << "info: "
    << location.file_name() << ":"
    << location.line() << ": "
    << message << endl;
}

int main() {
  Log("Log entry");
}

>_ info: ./example.cpp:18: Log entry

⬅️ Back to Contents