aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer
ModeNameSize
-rw-r--r--Dancer.c2367logstatsplain
-rw-r--r--Dancer.h581logstatsplain
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; }
    }
}