Skip to content

Commit

Permalink
use win compatible regex replacement for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bw-hro committed May 20, 2024
1 parent f2bb541 commit a1113c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/bw/webthing/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct logger
timestamp = dim + std::regex_replace(timestamp, std::regex{R"([\+])"}, " " + dim + "+");

// regex for time, ip 4/6, MAC, urls (with ports)
auto string_colored = color + std::regex_replace(msg, std::regex{R"("[^"]*"|'[^']*')"}, italic + "$0" + color_clear + color);
auto string_colored = log_use_color ? (color + std::regex_replace(msg, std::regex{R"("[^"]*"|'[^']*')"}, italic + "$&" + color_clear + color)) : msg;

// TODO: make log level configurable for THING (notify e, p, a), WEBSOCKET (in, open, close, broadcast), MDNS, Https (REQ (with/without body), RES)

Expand Down

0 comments on commit a1113c1

Please sign in to comment.