using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Diagnostics;

namespace CCNetLogReader
{
    public static class Logger
    {
        public static void Error(string message, string module="")
        {
            WriteEntry(message, "error", module);
        }

        public static void Error(Exception ex, string module = "")
        {
            WriteEntry(ex.Message, "error", module);
        }

        public static void Warning(string message, string module = "")
        {
            WriteEntry(message, "warning", module);
        }

        public static void Info(string message, string module = "")
        {
            WriteEntry(message, "info", module);
        }

        private static void WriteEntry(string message, string type, string module = "")
        {
            string text = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t{type}\t{message}";

            Trace.WriteLine(text, type);
        }
    }
}
