mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
635e76526a
(cherry picked from commit 609e964794e17343f63e1ecff3fef323e3d284ff)
27 lines
637 B
C#
27 lines
637 B
C#
using System.Text;
|
|
using NLog;
|
|
using NLog.Layouts;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
namespace NzbDrone.Common.Instrumentation;
|
|
|
|
public class CleansingConsoleLogLayout : SimpleLayout
|
|
{
|
|
public CleansingConsoleLogLayout(string format)
|
|
: base(format)
|
|
{
|
|
}
|
|
|
|
protected override void RenderFormattedMessage(LogEventInfo logEvent, StringBuilder target)
|
|
{
|
|
base.RenderFormattedMessage(logEvent, target);
|
|
|
|
if (RuntimeInfo.IsProduction)
|
|
{
|
|
var result = CleanseLogMessage.Cleanse(target.ToString());
|
|
target.Clear();
|
|
target.Append(result);
|
|
}
|
|
}
|
|
}
|