有没有使用NLog给特定单词上色的方法?我的目标是ColoredConsole
。NLog:ColoredConsole中的颜色特定单词
比方说,我要的颜色的longdate红色和调用点蓝色。什么是最好的方式来做到这一点?这似乎并不工作:
<target xsi:type="ColoredConsole"
name="debugConsole"
layout="${longdate} ${callsite} ${message}">
<highlight-word text="${longdate}" foregroundColor="Red" />
<highlight-word text="${callsite}" foregroundColor="Blue" />
</target>
见(https://github.com/nlog/NLog/wiki/ColoredConsole-target) – Amy
嗨艾米[为'ColoredConsoleTarget'文件],感谢您的帮助。我已经用我目前的尝试更新了我的问题。 – Aetherix
'text'属性不是'Layout'。这将是太昂贵,因此这不会工作。 – Julian