use std::function signature in argument?

This commit is contained in:
2024-06-28 13:06:43 -04:00
parent 5675480499
commit abb9eed60f
2 changed files with 2 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ namespace jlog
/// These are helper functions designed to be wrapped around for easier custom logger building.
/// @note This file is implemented differently per-platform to handle differences in console color handling.
/// @see windows/jlog.cpp linux/jlog.cpp
std::string toks2msg(std::vector<token> tokens, std::string (*formatter)(token));
std::string toks2msg(std::vector<token> tokens, std::function<std::string(token)> formatter);
std::string consoleMsgFormatter(token t);
std::string logfileMsgFormatter(token t);
std::string toks2consoleMsg(std::vector<token> tokens);

View File

@@ -55,7 +55,7 @@ namespace jlog
stream << message;
}
std::string toks2msg(std::vector<token> tokens, std::string (*formatter)(token))
std::string toks2msg(std::vector<token> tokens, std::function<std::string(token)> formatter)
{
std::string msg;
for (token t: tokens)