internal static void StartLatencyTracker(Guid cmdletUniqueId) { LatencyTracker latencyTracker = CmdletStaticDataWithUniqueId <LatencyTracker> .Get(cmdletUniqueId); if (latencyTracker != null) { CmdletLogger.SafeAppendGenericError(cmdletUniqueId, "StartLatencyTracker", string.Format("Latency tracker with this cmdlet {0} already exists. Override it anyway.", cmdletUniqueId), false); } latencyTracker = new LatencyTracker(cmdletUniqueId.ToString(), new Func <IActivityScope>(ActivityContext.GetCurrentActivityScope)); latencyTracker.Start(); CmdletStaticDataWithUniqueId <LatencyTracker> .Set(cmdletUniqueId, latencyTracker); }
internal static void SafeAppendGenericError(Guid cmdletUniqueId, string key, Exception ex, Func <Exception, bool> funcToVerifyException) { CmdletLogger.SafeAppendGenericError(cmdletUniqueId, key, (ex == null) ? null : ex.ToString(), funcToVerifyException(ex)); }
internal static void SafeAppendGenericError(string key, string value, bool isUnhandledException) { CmdletLogger.SafeAppendGenericError(Guid.Empty, key, value, isUnhandledException); }
internal static void SafeAppendGenericError(string key, Exception ex, Func <Exception, bool> funcToVerifyException) { CmdletLogger.SafeAppendGenericError(Guid.Empty, key, ex, funcToVerifyException); }