Skip to content

Commit

Permalink
Eqt trace error was thrown if extension uri is not given (#2264)
Browse files Browse the repository at this point in the history
* eqttrace error was thrown if extension uri is not given

* check for eqttrace error is enable or not

* formatted
  • Loading branch information
hvinett authored and singhsarab committed Dec 11, 2019
1 parent 6d87e50 commit f75b45c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public string ExtensionUri
private static string GetExtensionUri(Type testLoggerType)
{
string extensionUri = string.Empty;

object[] attributes = testLoggerType.GetTypeInfo().GetCustomAttributes(typeof(ExtensionUriAttribute), false).ToArray();
if (attributes != null && attributes.Length > 0)
{
Expand All @@ -79,6 +79,11 @@ private static string GetExtensionUri(Type testLoggerType)
}
}

if (EqtTrace.IsErrorEnabled && string.IsNullOrEmpty(extensionUri))
{
EqtTrace.Error("The type \"{0}\" defined in \"{1}\" does not have ExtensionUri attibute.", testLoggerType.ToString(), testLoggerType.Module.Name);
}

return extensionUri;
}
}
Expand Down

0 comments on commit f75b45c

Please sign in to comment.