diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Web/Logging/AzureCloudLogger.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Web/Logging/AzureCloudLogger.cs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Web/Logging/AzureCloudLogger.cs b/Software/Visual_Studio/Tango.Web/Logging/AzureCloudLogger.cs new file mode 100644 index 000000000..8cdc21d20 --- /dev/null +++ b/Software/Visual_Studio/Tango.Web/Logging/AzureCloudLogger.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Logging; + +namespace Tango.Web.Logging +{ + /// <summary> + /// Represents an azure blob storage logger. + /// </summary> + /// <seealso cref="Tango.Logging.ILogger" /> + public class AzureCloudLogger : ILogger + { + /// <summary> + /// Initializes a new instance of the <see cref="AzureCloudLogger"/> class. + /// </summary> + public AzureCloudLogger() + { + Enabled = true; + } + + /// <summary> + /// Called when a new log is available. + /// </summary> + /// <param name="log">The log.</param> + public void OnLog(LogItemBase log) + { + switch (log.Category) + { + case LogCategory.Info: + Trace.TraceInformation(log.ToString()); + break; + case LogCategory.Warning: + Trace.TraceWarning(log.ToString()); + break; + case LogCategory.Error: + Trace.TraceError(log.ToString()); + break; + case LogCategory.Critical: + Trace.TraceError(log.ToString()); + break; + case LogCategory.Debug: + Trace.WriteLine(log.ToString()); + break; + } + } + + /// <summary> + /// Gets or sets a value indicating whether this <see cref="T:Tango.Logging.ILogger" /> is enabled. + /// </summary> + public bool Enabled { get; set; } + } +} |
