Exemplo n.º 1
0
        public static void Log(LogLevels level, string str)
        {
            if (level < LogLevel)
            {
                return;
            }

            var st = $"{DateTime.Now} /{Thread.CurrentThread.ManagedThreadId,3}/: {str.TrimEnd( TrimEndChars )}";

            lock ( Lock )
            {
                if (LogToConsole)
                {
                    Console.WriteLine(st);
                }
                if (LogToDebug)
                {
                    System.Diagnostics.Debug.WriteLine(st);
                }

                if (Store != null)
                {
                    CheckFileRotation.Do(Store.CheckStoreRotation);
                    Store.Log(st);
                }
            }
        }