using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quadarax.Foundation.Core.Logging;

namespace qdr.fnd.core.pqueue.test.Mocks
{
    public class LogMock : ILog
    {
        #region Implementation of ILog

        /// <inheritdoc />
        public void Log(LogSeverityEnum severity, int code, string message)
        {
            Trace.WriteLine($"[{code}]: {message}", severity.ToString());
        }

        /// <inheritdoc />
        public void Log(LogSeverityEnum severity, string message)
        {
            Trace.WriteLine($"{message}", severity.ToString());
        }

        /// <inheritdoc />
        public void Log(LogSeverityEnum severity, string message, Exception? exception)
        {
            if (exception != null)
                Trace.WriteLine($"{message}\n{exception}", severity.ToString());
            else
                Trace.WriteLine($"{message}", severity.ToString());
        }

        /// <inheritdoc />
        public void Log(LogSeverityEnum severity, int code, string message, Exception? exception)
        {
            if (exception != null)
                Trace.WriteLine($"[{code}] {message}\n{exception}", severity.ToString());
            else
                Trace.WriteLine($"[{code}] {message}", severity.ToString());

        }

        #endregion
    }
}
