From 7092a4e862e784cae34ac1346eebd4038a42144d Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Mon, 9 Feb 2015 17:29:20 +0100 Subject: Allowing tokens to be passed to logger functions --- src/plugins/plain/DynamicTokenizer.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/plugins/plain/DynamicTokenizer.hpp b/src/plugins/plain/DynamicTokenizer.hpp index 0b4dd39..0cac2e8 100644 --- a/src/plugins/plain/DynamicTokenizer.hpp +++ b/src/plugins/plain/DynamicTokenizer.hpp @@ -85,6 +85,14 @@ struct DynamicToken { * @param type is the id corresponding to the type of the token. */ DynamicToken(TokenTypeId type) : type(type) {} + + /** + * The getLocation function allows the tokens to be directly passed as + * parameter to Logger or LoggableException instances. + * + * @return a reference at the location field + */ + const SourceLocation &getLocation() const { return location; } }; /** -- cgit v1.2.3