protected override void BeginProcessing() { InitializeEventHandlers(); AzureSession.Instance.ClientFactory.RemoveHandler(typeof(RPRegistrationDelegatingHandler)); IAzureContext context; if (RequireDefaultContext() && TryGetDefaultContext(out context) && context.Account != null && context.Subscription != null) { AzureSession.Instance.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler( () => { var client = new ResourceManagementClient( context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager), AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(context, AzureEnvironment.Endpoint.ResourceManager)); client.SubscriptionId = context.Subscription.Id; return(client); }, s => DebugMessages.Enqueue(s))); } base.BeginProcessing(); }
/// <summary> /// Creates new instance from AzureRMCmdlet and add the RPRegistration handler. /// </summary> public AzureRMCmdlet() { AzureSession.ClientFactory.RemoveHandler(typeof(RPRegistrationDelegatingHandler)); AzureSession.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler( () => new ResourceManagementClient( AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(DefaultContext, AzureEnvironment.Endpoint.ResourceManager), DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager)), s => DebugMessages.Enqueue(s))); }
protected override void BeginProcessing() { AzureSession.Instance.ClientFactory.RemoveHandler(typeof(RPRegistrationDelegatingHandler)); AzureSession.Instance.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler( () => new ResourceManagementClient( DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager), AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(DefaultContext, AzureEnvironment.Endpoint.ResourceManager)), s => DebugMessages.Enqueue(s))); base.BeginProcessing(); }
protected virtual void SetupDebuggingTraces() { _httpTracingInterceptor = _httpTracingInterceptor ?? new RecordingTracingInterceptor(DebugMessages, _matchers); _adalListener = _adalListener ?? new DebugStreamTraceListener(DebugMessages); RecordingTracingInterceptor.AddToContext(_httpTracingInterceptor); DebugStreamTraceListener.AddAdalTracing(_adalListener); if (AzureSession.Instance.TryGetComponent(nameof(IAzureEventListenerFactory), out IAzureEventListenerFactory factory)) { _azureEventListener = factory.GetAzureEventListener( (message) => { DebugMessages.Enqueue(message); }); } }
public void Debug(string message, params object[] items) { DebugMessages.Enqueue(message); _logger.Debug(message, items); }
public void LogDebug(string data) { Messages.Enqueue(data); DebugMessages.Enqueue(data); DumpMessage("DEBUG", data); }
private void EnqueueDebugSender(object sender, StreamEventArgs args) { DebugMessages.Enqueue(args.Message); }
public static void LogDebug(string _message) { // TODO: look into using string builder to optomise string concatenation DebugMessages.Enqueue(GeneratePostMessageText() + _message); }