Updated an error logging call in the Log class. Changed the redirected logging to use the lazy overload in case Info isn't enabled in the config.

This commit is contained in:
Shannon Deminick
2012-12-27 17:22:08 +03:00
parent 5e4c4ae57c
commit 116a87f5c5

View File

@@ -175,13 +175,14 @@ namespace umbraco.BusinessLogic
}
catch (Exception e)
{
Debug.WriteLine(e.ToString(), "Error");
Trace.WriteLine(e.ToString());
LogHelper.Error<Log>("An error occurred adding an audit trail log to the umbracoLog table", e);
}
}
else
{
LogHelper.Info<Log>(string.Format("Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: {0} | User: {1} | NodeId: {2} | Comment: {3}", type.ToString(), userId, nodeId.ToString(CultureInfo.InvariantCulture), comment));
LogHelper.Info<Log>(
"Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: {0} | User: {1} | NodeId: {2} | Comment: {3}",
() => type.ToString(), () => userId, () => nodeId.ToString(CultureInfo.InvariantCulture), () => comment);
}
}