From 357a13b404c8eb74a3f29ceed597a02cc5509801 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sat, 24 Apr 2021 20:01:26 -0700 Subject: [PATCH] AK: Add a AK::Formatter implementation for AK::SourceLocation --- AK/SourceLocation.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AK/SourceLocation.h b/AK/SourceLocation.h index ee77526fcf..ba9366c48f 100644 --- a/AK/SourceLocation.h +++ b/AK/SourceLocation.h @@ -7,6 +7,7 @@ #pragma once +#include #include #include @@ -38,4 +39,12 @@ private: } +template<> +struct AK::Formatter : AK::Formatter { + void format(FormatBuilder& builder, AK::SourceLocation location) + { + return AK::Formatter::format(builder, "[{} @ {}:{}]", location.function_name(), location.file_name(), location.line_number()); + } +}; + using AK::SourceLocation;