using System;
using System.Collections.Generic;
using System.IO;
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 Topic)
    {
        if(Library.ConfigurationManager.EnvironmentFlag == 2)
        {
            Dictionary<string, string> dic = new Dictionary<string, string>();
            dic.Add("Topic", Topic);
            dic.Add("Content", Content);
            RedisDbconn.Instance.AddList("SlsLogQueue", Newtonsoft.Json.JsonConvert.SerializeObject(dic));
        }
        else
        {
            Utils.WriteLog(Content, Topic);
        }
    }

}