From 8bce347b3b486b4ec026390614478a3bad1272f0 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Thu, 27 Jun 2019 15:58:43 -0700 Subject: [PATCH] Add some missing doc comments --- .../src/BatchingLoggerOptions.cs | 3 +++ .../src/BatchingLoggerProvider.cs | 24 ++++++++++++++++++- .../src/BlobLoggerProvider.cs | 2 +- .../src/FileLoggerProvider.cs | 7 ++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/Logging/Logging.AzureAppServices/src/BatchingLoggerOptions.cs b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerOptions.cs index 23998fb5d1..b474af5489 100644 --- a/src/Logging/Logging.AzureAppServices/src/BatchingLoggerOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerOptions.cs @@ -5,6 +5,9 @@ using System; namespace Microsoft.Extensions.Logging.AzureAppServices { + /// + /// Options for a logger which batches up log messages. + /// public class BatchingLoggerOptions { private int? _batchSize; diff --git a/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs index 7d0bd3ae40..5cf8ccd27c 100644 --- a/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs @@ -10,7 +10,10 @@ using Microsoft.Extensions.Options; namespace Microsoft.Extensions.Logging.AzureAppServices { - public abstract class BatchingLoggerProvider: ILoggerProvider, ISupportExternalScope + /// + /// A provider of 's. + /// + public abstract class BatchingLoggerProvider : ILoggerProvider, ISupportExternalScope { private readonly List _currentBatch = new List(); private readonly TimeSpan _interval; @@ -51,6 +54,9 @@ namespace Microsoft.Extensions.Logging.AzureAppServices UpdateOptions(options.CurrentValue); } + /// + /// Checks if the queue is enabled. + /// public bool IsEnabled { get; private set; } private void UpdateOptions(BatchingLoggerOptions options) @@ -113,6 +119,12 @@ namespace Microsoft.Extensions.Logging.AzureAppServices } } + /// + /// Wait for the given . + /// + /// The amount of time to wait. + /// A that can be used to cancel the delay. + /// A which completes when the has passed or the has been canceled. protected virtual Task IntervalAsync(TimeSpan interval, CancellationToken cancellationToken) { return Task.Delay(interval, cancellationToken); @@ -163,6 +175,7 @@ namespace Microsoft.Extensions.Logging.AzureAppServices } } + /// public void Dispose() { _optionsChangeToken?.Dispose(); @@ -172,11 +185,20 @@ namespace Microsoft.Extensions.Logging.AzureAppServices } } + /// + /// Creates a with the given . + /// + /// The name of the category to create this logger with. + /// The that was created. public ILogger CreateLogger(string categoryName) { return new BatchingLogger(this, categoryName); } + /// + /// Sets the scope on this provider. + /// + /// Provides the scope. void ISupportExternalScope.SetScopeProvider(IExternalScopeProvider scopeProvider) { _scopeProvider = scopeProvider; diff --git a/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs index 1a60bee215..77182ea933 100644 --- a/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs @@ -27,7 +27,7 @@ namespace Microsoft.Extensions.Logging.AzureAppServices /// /// Creates a new instance of /// - /// + /// The options to use when creating a provider. public BlobLoggerProvider(IOptionsMonitor options) : this(options, null) { diff --git a/src/Logging/Logging.AzureAppServices/src/FileLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/FileLoggerProvider.cs index b80322139a..fb34d63d5b 100644 --- a/src/Logging/Logging.AzureAppServices/src/FileLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/FileLoggerProvider.cs @@ -10,6 +10,9 @@ using Microsoft.Extensions.Options; namespace Microsoft.Extensions.Logging.AzureAppServices { + /// + /// A which writes out to a file. + /// [ProviderAlias("AzureAppServicesFile")] public class FileLoggerProvider : BatchingLoggerProvider { @@ -18,6 +21,10 @@ namespace Microsoft.Extensions.Logging.AzureAppServices private readonly int? _maxFileSize; private readonly int? _maxRetainedFiles; + /// + /// Creates a new instance of . + /// + /// The options to use when creating a provider. public FileLoggerProvider(IOptionsMonitor options) : base(options) { var loggerOptions = options.CurrentValue;