Skip to content

Commit c918cbf

Browse files
authored
Merge pull request #379 from RenderMichael/master
Only log to Error in DEBUG mode
2 parents c13fedf + ea89f52 commit c918cbf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

PdfSharpCore/Utils/FontResolver.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ public static void SetupFontsFiles(string[] sSupportedFonts)
125125
}
126126
catch (System.Exception e)
127127
{
128+
#if DEBUG
128129
System.Console.Error.WriteLine(e);
130+
#endif
129131
}
130132
}
131133

@@ -139,7 +141,9 @@ public static void SetupFontsFiles(string[] sSupportedFonts)
139141
}
140142
catch (System.Exception e)
141143
{
144+
#if DEBUG
142145
System.Console.Error.WriteLine(e);
146+
#endif
143147
}
144148
}
145149

PdfSharpCore/Utils/LinuxSystemFontResolver.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ public static string[] Resolve()
136136
}
137137
catch(Exception ex)
138138
{
139+
#if DEBUG
139140
Console.Error.WriteLine(ex.ToString());
141+
#endif
140142
return ResolveFallback().Where(x => x.EndsWith(".ttf", StringComparison.OrdinalIgnoreCase)).ToArray();
141143
}
142144
}
@@ -194,8 +196,10 @@ static IEnumerable<string> SearchPaths()
194196
}
195197
catch (Exception ex)
196198
{
199+
#if DEBUG
197200
Console.Error.WriteLine(ex.Message);
198201
Console.Error.WriteLine(ex.StackTrace);
202+
#endif
199203
}
200204

201205
dirs.Add("/usr/share/fonts");

0 commit comments

Comments
 (0)