From 2dbf8ba2193b2d32fce875a4f883eb496a18f014 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 18 Apr 2020 02:31:54 +0300 Subject: [PATCH] Make logger name colored --- base/loggers/OwnPatternFormatter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base/loggers/OwnPatternFormatter.cpp b/base/loggers/OwnPatternFormatter.cpp index 1f918f01697..029d06ff949 100644 --- a/base/loggers/OwnPatternFormatter.cpp +++ b/base/loggers/OwnPatternFormatter.cpp @@ -75,7 +75,11 @@ void OwnPatternFormatter::formatExtended(const DB::ExtendedLogMessage & msg_ext, if (color) writeCString(resetColor(), wb); writeCString("> ", wb); + if (color) + writeString(setColor(std::hash()(msg.getSource())), wb); DB::writeString(msg.getSource(), wb); + if (color) + writeCString(resetColor(), wb); writeCString(": ", wb); DB::writeString(msg.getText(), wb); }