public TelemetryScope <UserTaskEvent> StartUserTask(string eventName) { #if DEBUG _ = WriteLineToOutputWindowAsync($"Started User Task: {eventName}"); #endif return(_session.StartUserTask(eventName)); }
private object CreateAndStartScope(LogType kind, FunctionId functionId) { // use object since TelemetryScope<UserTask> and // TelemetryScope<Operation> can't be shared var eventName = functionId.GetEventName(); return(kind switch { LogType.Trace => _session.StartOperation(eventName), LogType.UserAction => _session.StartUserTask(eventName), _ => (object)FatalError.Report(new Exception($"unknown type: {kind}")), });
private object CreateAndStartScope(LogType kind, FunctionId functionId) { // use object since TelemetryScope<UserTask> and // TelemetryScope<Operation> can't be shared var eventName = functionId.GetEventName(); return(kind switch { LogType.Trace => _session.StartOperation(eventName), LogType.UserAction => _session.StartUserTask(eventName), _ => throw ExceptionUtilities.UnexpectedValue(kind), });
private object CreateAndStartScope(LogType kind, FunctionId functionId) { // use object since TelemetryScope<UserTask> and // TelemetryScope<Operation> can't be shared var eventName = functionId.GetEventName(); switch (kind) { case LogType.Trace: return(_session.StartOperation(eventName)); case LogType.UserAction: return(_session.StartUserTask(eventName)); default: return(FatalError.Report(new Exception($"unknown type: {kind}"))); } }