提交 97230c2d 编写于 作者: H Heejae Chang

remove unused API and updated comment

上级 a1d8906c
......@@ -277,19 +277,6 @@ public void LogException(object source, Exception exception)
Messages.Add(source.GetType().Name, ToLogFormat(exception));
}
public bool TryLogException(object source, Exception exception)
{
try
{
Messages.Add(source.GetType().Name, ToLogFormat(exception));
return true;
}
catch (Exception)
{
return false;
}
}
private static string ToLogFormat(Exception exception)
{
return exception.Message + Environment.NewLine + exception.StackTrace;
......
......@@ -23,21 +23,6 @@ public void LogException(object source, Exception exception)
}
}
public bool TryLogException(object source, Exception exception)
{
bool watsonReportResult = true;
var name = source.GetType().Name;
var activityLogResult = ActivityLog.TryLogError(name, ToLogFormat(exception));
if (ShouldReportCrashDumps(source))
{
WatsonReporter.Report(name, exception);
}
return watsonReportResult && activityLogResult;
}
private bool ShouldReportCrashDumps(object source) => HasRoslynPublicKey(source);
private static string ToLogFormat(Exception exception)
......
......@@ -21,7 +21,7 @@ public static void Report(Exception exception)
/// <summary>
/// Report Non-Fatal Watson
/// </summary>
/// <param name="description">watson description</param>
/// <param name="description">any description you want to save with this watson report</param>
/// <param name="exception">Exception that triggered this non-fatal error</param>
public static void Report(string description, Exception exception)
{
......
......@@ -8,6 +8,5 @@ namespace Microsoft.CodeAnalysis.ErrorLogger
internal interface IErrorLoggerService : IWorkspaceService
{
void LogException(object source, Exception exception);
bool TryLogException(object source, Exception exception);
}
}
......@@ -15,20 +15,6 @@ public void LogException(object source, Exception exception)
Logger.GetLogger()?.Log(FunctionId.Extension_Exception, LogMessage.Create(source.GetType().Name + " : " + ToLogFormat(exception)));
}
public bool TryLogException(object source, Exception exception)
{
var logger = Logger.GetLogger();
var name = source.GetType().Name;
if (logger != null)
{
logger.Log(FunctionId.Extension_Exception, LogMessage.Create(name + " : " + ToLogFormat(exception)));
return true;
}
return false;
}
private static string ToLogFormat(Exception exception)
{
return exception.Message + Environment.NewLine + exception.StackTrace;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册