예제 #1
0
        private static string GetMsg(string s, string name, string path, int ln, LogType lType = LogType.Blank)
        {
            if (lType == LogType.Error || lType == LogType.Exception || lType == LogType.StackTrace)
            {
                EncounteredError = true;
            }
            string append =
                $"{lType.Str()}[{DateTime.Now}] [{Path.GetFileNameWithoutExtension(path)}.{name} ln {ln}] - ";
            string msg = $"{append}{s}";

            if (lType == LogType.Error || lType == LogType.Exception || lType == LogType.StackTrace)
            {
                WriteConsoleError(msg);
            }
            else
            {
                Console.WriteLine(msg);
            }
            return(msg);
        }