private bool IsWarningSuppressed(ILogMessage message)
        {
            if (message.Level == LogLevel.Warning)
            {
                // If the WarningPropertiesCollection is present then test if the warning is suppressed in
                // project wide no warn
                if (WarningPropertiesCollection.ApplyProjectWideNoWarnProperties(message, warningProperties: WarningProperties))
                {
                    return(true);
                }
                else
                {
                    // Use packagereference warning properties only if the project does not suppress the warning
                    // In packagereference warning properties look at only the package specific ones as all properties are per package reference.
                    IPackLogMessage packLogMessage = message as IPackLogMessage;

                    if (packLogMessage != null)
                    {
                        return(PackageSpecificWarningProperties?.ApplyNoWarnProperties(packLogMessage) == true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        private bool IsWarningSuppressed(ILogMessage message)
        {
            if (message.Level == LogLevel.Warning)
            {
                return(WarningPropertiesCollection.ApplyProjectWideNoWarnProperties(message, warningProperties: WarningProperties));
            }

            return(false);
        }