Change Warn to LogWarning
This commit is contained in:
@@ -442,7 +442,7 @@ namespace Umbraco.Core.Composing
|
||||
if (_notifiedLoadExceptionAssemblies.Contains(a.FullName) == false)
|
||||
{
|
||||
_notifiedLoadExceptionAssemblies.Add(a.FullName);
|
||||
_logger.Warn(typeof (TypeFinder), ex, "Could not load all types from {TypeName}.", a.GetName().Name);
|
||||
_logger.LogWarning(typeof (TypeFinder), ex, "Could not load all types from {TypeName}.", a.GetName().Name);
|
||||
}
|
||||
}
|
||||
return rex.Types.WhereNotNull().ToArray();
|
||||
|
||||
@@ -674,7 +674,7 @@ namespace Umbraco.Core.Composing
|
||||
else
|
||||
{
|
||||
// in case of any exception, we have to exit, and revert to scanning
|
||||
_logger.Warn<TypeLoader>("Getting {TypeName}: failed to load cache file type {CacheType}, reverting to scanning assemblies.", GetName(baseType, attributeType), type);
|
||||
_logger.LogWarning<TypeLoader>("Getting {TypeName}: failed to load cache file type {CacheType}, reverting to scanning assemblies.", GetName(baseType, attributeType), type);
|
||||
scan = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Umbraco.Web.ContentApps
|
||||
// dying is not user-friendly, so let's write to log instead, and wish people read logs...
|
||||
|
||||
//throw new InvalidOperationException($"Duplicate content app aliases found: {string.Join(",", dups)}");
|
||||
_logger.Warn<ContentAppFactoryCollection>("Duplicate content app aliases found: {DuplicateAliases}", string.Join(",", dups));
|
||||
_logger.LogWarning<ContentAppFactoryCollection>("Duplicate content app aliases found: {DuplicateAliases}", string.Join(",", dups));
|
||||
}
|
||||
|
||||
return apps;
|
||||
|
||||
@@ -70,23 +70,23 @@ namespace Umbraco.Core.Logging
|
||||
Console.WriteLine("ERROR {0} - {1}", reporting.Name, _messageTemplates.Render(messageTemplate, propertyValues));
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, string message)
|
||||
public void LogWarning(Type reporting, string message)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, message);
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, string message, params object[] propertyValues)
|
||||
public void LogWarning(Type reporting, string message, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, _messageTemplates.Render(message, propertyValues));
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, Exception exception, string message)
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, message);
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, Exception exception, string message, params object[] propertyValues)
|
||||
public void LogWarning(Type reporting, Exception exception, string message, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, _messageTemplates.Render(message, propertyValues));
|
||||
Console.WriteLine(exception);
|
||||
|
||||
@@ -78,25 +78,25 @@ namespace Umbraco.Core.Logging
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Warn(Type reporting, string message)
|
||||
public void LogWarning(Type reporting, string message)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(message, reporting.FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Warn(Type reporting, string message, params object[] propertyValues)
|
||||
public void LogWarning(Type reporting, string message, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message, propertyValues), reporting.FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Warn(Type reporting, Exception exception, string message)
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(message + Environment.NewLine + exception, reporting.FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Warn(Type reporting, Exception exception, string message, params object[] propertyValues)
|
||||
public void LogWarning(Type reporting, Exception exception, string message, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message + Environment.NewLine + exception, propertyValues), reporting.FullName);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Umbraco.Core.Logging
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
void Warn(Type reporting, string message);
|
||||
void LogWarning(Type reporting, string message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message.
|
||||
@@ -115,7 +115,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
void Warn(Type reporting, string messageTemplate, params object[] propertyValues);
|
||||
void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
@@ -123,7 +123,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
void Warn(Type reporting, Exception exception, string message);
|
||||
void LogWarning(Type reporting, Exception exception, string message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
@@ -132,7 +132,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues);
|
||||
void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an information message.
|
||||
|
||||
@@ -71,8 +71,8 @@ namespace Umbraco.Core.Logging
|
||||
/// <typeparam name="T">The reporting type.</typeparam>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
public static void Warn<T>(this ILogger logger, string message)
|
||||
=> logger.Warn(typeof(T), message);
|
||||
public static void LogWarning<T>(this ILogger logger, string message)
|
||||
=> logger.LogWarning(typeof(T), message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message.
|
||||
@@ -81,8 +81,8 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
public static void Warn<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.Warn(typeof(T), messageTemplate, propertyValues);
|
||||
public static void LogWarning<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.LogWarning(typeof(T), messageTemplate, propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
@@ -91,8 +91,8 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
public static void Warn<T>(this ILogger logger, Exception exception, string message)
|
||||
=> logger.Warn(typeof(T), exception, message);
|
||||
public static void LogWarning<T>(this ILogger logger, Exception exception, string message)
|
||||
=> logger.LogWarning(typeof(T), exception, message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
@@ -102,8 +102,8 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
public static void Warn<T>(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.Warn(typeof(T), exception, messageTemplate, propertyValues);
|
||||
public static void LogWarning<T>(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.LogWarning(typeof(T), exception, messageTemplate, propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an information message.
|
||||
|
||||
@@ -56,22 +56,22 @@ namespace Umbraco.Core.Logging
|
||||
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, string message)
|
||||
public void LogWarning(Type reporting, string message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
public void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, Exception exception, string message)
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
public void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -97,17 +97,17 @@ namespace Umbraco.Core.Logging
|
||||
public void LogError(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogError(reporting, messageTemplate, propertyValues);
|
||||
|
||||
public void Warn(Type reporting, string message)
|
||||
=> Logger.Warn(reporting, message);
|
||||
public void LogWarning(Type reporting, string message)
|
||||
=> Logger.LogWarning(reporting, message);
|
||||
|
||||
public void Warn(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.Warn(reporting, messageTemplate, propertyValues);
|
||||
public void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogWarning(reporting, messageTemplate, propertyValues);
|
||||
|
||||
public void Warn(Type reporting, Exception exception, string message)
|
||||
=> Logger.Warn(reporting, exception, message);
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
=> Logger.LogWarning(reporting, exception, message);
|
||||
|
||||
public void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.Warn(reporting, exception, messageTemplate, propertyValues);
|
||||
public void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogWarning(reporting, exception, messageTemplate, propertyValues);
|
||||
|
||||
public void Info(Type reporting, string message)
|
||||
=> Logger.Info(reporting, message);
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
void DoLog(string logPropertyAlias, string logPropertyName)
|
||||
{
|
||||
Current.Logger.Warn<Member>("Trying to access the '{PropertyName}' property on '{MemberType}' " +
|
||||
Current.Logger.LogWarning<Member>("Trying to access the '{PropertyName}' property on '{MemberType}' " +
|
||||
"but the {PropertyAlias} property does not exist on the member type so a default value is returned. " +
|
||||
"Ensure that you have a property type with alias: {PropertyAlias} configured on your member type in order to use the '{PropertyName}' property on the model correctly.",
|
||||
logPropertyName,
|
||||
@@ -497,7 +497,7 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
void DoLog(string logPropertyAlias, string logPropertyName)
|
||||
{
|
||||
Current.Logger.Warn<Member>("An attempt was made to set a value on the property '{PropertyName}' on type '{MemberType}' but the " +
|
||||
Current.Logger.LogWarning<Member>("An attempt was made to set a value on the property '{PropertyName}' on type '{MemberType}' but the " +
|
||||
"property type {PropertyAlias} does not exist on the member type, ensure that this property type exists so that setting this property works correctly.",
|
||||
logPropertyName,
|
||||
typeof(Member),
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Umbraco.Core.Packaging
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Warn<PackageDefinitionXmlParser>(e, "Could not add package actions to the package xml definition, the xml did not parse");
|
||||
_logger.LogWarning<PackageDefinitionXmlParser>(e, "Could not add package actions to the package xml definition, the xml did not parse");
|
||||
}
|
||||
|
||||
var packageXml = new XElement("package",
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace Umbraco.Core.Packaging
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Warn<PackagesRepository>(e, "Could not add package actions to the package, the xml did not parse");
|
||||
_logger.LogWarning<PackagesRepository>(e, "Could not add package actions to the package, the xml did not parse");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Umbraco.Web.Routing
|
||||
// IsAllowedTemplate deals both with DisableAlternativeTemplates and ValidateAlternativeTemplates settings
|
||||
if (!node.IsAllowedTemplate(_contentTypeService, _webRoutingSettings, template.Id))
|
||||
{
|
||||
Logger.Warn<ContentFinderByUrlAndTemplate>("Alternative template '{TemplateAlias}' is not allowed on node {NodeId}.", template.Alias, node.Id);
|
||||
Logger.LogWarning<ContentFinderByUrlAndTemplate>("Alternative template '{TemplateAlias}' is not allowed on node {NodeId}.", template.Alias, node.Id);
|
||||
frequest.PublishedContent = null; // clear
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ namespace Umbraco.Web.Routing
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Warn<PublishedRouter>("FindTemplate: Alternative template {TemplateAlias} is not allowed on node {NodeId}, ignoring.", altTemplate, request.PublishedContent.Id);
|
||||
_logger.LogWarning<PublishedRouter>("FindTemplate: Alternative template {TemplateAlias} is not allowed on node {NodeId}, ignoring.", altTemplate, request.PublishedContent.Id);
|
||||
|
||||
// no allowed, back to default
|
||||
var templateId = request.PublishedContent.TemplateId;
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Umbraco.Core.Runtime
|
||||
if (_signaled) return false;
|
||||
if (_isMainDom == false)
|
||||
{
|
||||
_logger.Warn<MainDom>("Register called when MainDom has not been acquired");
|
||||
_logger.LogWarning<MainDom>("Register called when MainDom has not been acquired");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace Umbraco.Core.Runtime
|
||||
catch (OperationCanceledException ex)
|
||||
{
|
||||
// the waiting task could be canceled if this appdomain is naturally shutting down, we'll just swallow this exception
|
||||
_logger.Warn<MainDom>(ex, ex.Message);
|
||||
_logger.LogWarning<MainDom>(ex, ex.Message);
|
||||
}
|
||||
|
||||
_logger.Info<MainDom>("Acquired.");
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Umbraco.Web.Scheduling
|
||||
var umbracoAppUrl = _requestAccessor.GetApplicationUrl().ToString();
|
||||
if (umbracoAppUrl.IsNullOrWhiteSpace())
|
||||
{
|
||||
_logger.Warn<KeepAlive>("No umbracoApplicationUrl for service (yet), skip.");
|
||||
_logger.LogWarning<KeepAlive>("No umbracoApplicationUrl for service (yet), skip.");
|
||||
return true; // repeat
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user