Merge pull request #10343 from azat/colored-logger-name

[RFC] Make logger name colored
This commit is contained in:
alexey-milovidov 2020-04-18 04:15:48 +03:00 committed by GitHub
commit a551e1f33b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,11 @@ void OwnPatternFormatter::formatExtended(const DB::ExtendedLogMessage & msg_ext,
if (color) if (color)
writeCString(resetColor(), wb); writeCString(resetColor(), wb);
writeCString("> ", wb); writeCString("> ", wb);
if (color)
writeString(setColor(std::hash<std::string>()(msg.getSource())), wb);
DB::writeString(msg.getSource(), wb); DB::writeString(msg.getSource(), wb);
if (color)
writeCString(resetColor(), wb);
writeCString(": ", wb); writeCString(": ", wb);
DB::writeString(msg.getText(), wb); DB::writeString(msg.getText(), wb);
} }