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

namespace StartServerWPF.Assets
{
    public class LogHelper
    {

        public static void WriteSerLog(string fn, string logstr)
        {
           // try
            {
                fn = fn + "SerLog_" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
                if (!File.Exists(fn))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(fn));
                }
                using (StreamWriter sw = new StreamWriter(fn, true, Encoding.Default))
                {
                    sw.WriteLine(logstr);
                    sw.Close();
                }
            }
            //catch (Exception ex)
            //{
               
            //}
        }
    }
}
