예제 #1
0
파일: Log.cs 프로젝트: lee1431/uno
        public void Warning1(Source src, object code, string msg)
        {
            // Silence warnings from cached packages (unless -W3 was passed)
            if (src.Package.IsCached && WarningLevel < 3 || src.Package.IsVerified ||
                MaxErrorCount > 0 && WarningCount >= MaxErrorCount ||
                WarningLevel == 0)
            {
                return;
            }

            // Silence warnings from UX generated code (unless -W3 was passed)
            if (src.FullPath.EndsWith(".g.uno") && WarningLevel < 3)
            {
                return;
            }

            var str = code?.ToString() ?? "W0000";

            Report(src, str, msg, ConsoleColor.Yellow);

            lock (Errors)
            {
                WarningCount++;
                Errors.AddWarning(src, str, msg);
            }
        }