From 27fb51564c753dd9412aad221ee48b360b9a0251 Mon Sep 17 00:00:00 2001 From: Rolf Kristensen Date: Sun, 26 May 2019 01:00:42 +0200 Subject: [PATCH] ObjectReflectionCache - Skip property-reflection for IFormattable --- src/NLog/Internal/ObjectReflectionCache.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/NLog/Internal/ObjectReflectionCache.cs b/src/NLog/Internal/ObjectReflectionCache.cs index 5571c5d8cd..525b5e29cc 100644 --- a/src/NLog/Internal/ObjectReflectionCache.cs +++ b/src/NLog/Internal/ObjectReflectionCache.cs @@ -177,10 +177,7 @@ private static ObjectPropertyInfos BuildObjectPropertyInfos(object value, Type o private static bool ConvertToString(Type objectType) { - if (objectType == typeof(Guid)) - return true; - - if (objectType == typeof(TimeSpan)) + if (typeof(IFormattable).IsAssignableFrom(objectType)) return true; if (typeof(Uri).IsAssignableFrom(objectType))