AIMS_BD_IATI.DAL.Logger.Write C# (CSharp) Method

Write() public static method

public static Write ( string Text ) : void
Text string
return void
        public static void Write(string Text)
        {
            string dirPath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\Log\\";

            DirectoryInfo directoryInfo = new DirectoryInfo(dirPath);
            if (!directoryInfo.Exists)
                directoryInfo.Create();

            string filePath = dirPath + DateTime.Now.ToString("yyyy-MM-dd") + "_Log.txt";

            File.AppendAllText(filePath,
                Environment.NewLine +
                DateTime.Now.ToString("d-MMM-yyyy, HH:mm:ss") + "  " + Text);

            System.Console.WriteLine(Text);
        }