B2017-257 A warning message was being added to the error log each time a macro was being used. This was changed so that the warning would only be added once per session.

This commit is contained in:
Rich 2017-11-14 20:41:45 +00:00
parent db7562af57
commit 2edf051cb6

View File

@ -417,6 +417,7 @@ namespace Volian.Svg.Library
public partial class SvgUse : SvgPartInheritance
{
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static List<string> _MissingMacros = new List<string>();
public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
{
// TODO: Could I use the template
@ -425,7 +426,11 @@ namespace Volian.Svg.Library
mySvg[_UseID].Draw(cb, scale.AdjustOrigin(X, Y), mySvg, this);
else
{
_MyLog.WarnFormat("Missing Macro '{0}'", _UseID);
if (!_MissingMacros.Contains(_UseID))
{
_MissingMacros.Add(_UseID);
_MyLog.WarnFormat("Missing Macro '{0}'", _UseID);
}
}
//cb.AddTemplate(mySvg.GetTemplate(_UseID.Substring(1),cb), scale.X(X), scale.Y(cb, Y));
}