using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using Library;
using LitJson;
using MySystem;

public class LogHelper
{
    public readonly static LogHelper Instance = new LogHelper();
    private LogHelper()
    { }

    public void WriteLog(string Content, string FileName, bool sls = false)
    {
        if(sls)
        {
            Dictionary<string, string> dic = new Dictionary<string, string>();
            dic.Add("Topic", FileName);
            dic.Add("Content", Content);
            KxsRedisDbconn.Instance.AddList("SlsLogQueue", Newtonsoft.Json.JsonConvert.SerializeObject(dic));
        }
        else
        {
            Utils.WriteLog(Content, FileName);
        }
    }
}