Skip to content

Commit

Permalink
Fixed incorrect logging overload
Browse files Browse the repository at this point in the history
  • Loading branch information
roryprimrose committed Feb 8, 2020
1 parent b35b64e commit bf311d8
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions ModelBuilder/DefaultBuildLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void BuildFailure(Exception ex)
throw new ArgumentNullException(nameof(ex));
}

WriteMessage(ex.ToString());
FormatAndWriteMessage(ex.ToString());
}

/// <inheritdoc />
Expand All @@ -37,7 +37,7 @@ public void CircularReferenceDetected(Type type)
throw new ArgumentNullException(nameof(type));
}

WriteMessage(Resources.DefaultBuildLog_CircularReferenceDetected, type.FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_CircularReferenceDetected, type.FullName);
}

/// <inheritdoc />
Expand Down Expand Up @@ -69,7 +69,7 @@ public void CreatedParameter(Type instanceType, Type parameterType, string param

_indent--;

WriteMessage(
FormatAndWriteMessage(
Resources.DefaultBuildLog_CreatedParameter,
parameterName,
parameterType.FullName,
Expand Down Expand Up @@ -99,7 +99,7 @@ public void CreatedProperty(Type propertyType, string propertyName, object conte

_indent--;

WriteMessage(
FormatAndWriteMessage(
Resources.DefaultBuildLog_CreatedProperty,
propertyName,
propertyType.FullName,
Expand All @@ -117,7 +117,7 @@ public void CreatedType(Type type, object context)

_indent--;

WriteMessage(Resources.DefaultBuildLog_CreatedType, type.FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_CreatedType, type.FullName);
}

/// <inheritdoc />
Expand All @@ -141,7 +141,7 @@ public void CreatingParameter(Type instanceType, Type parameterType, string para
throw new ArgumentNullException(nameof(parameterName));
}

WriteMessage(
FormatAndWriteMessage(
Resources.DefaultBuildLog_CreatingParameter,
parameterName,
parameterType.FullName,
Expand Down Expand Up @@ -171,7 +171,7 @@ public void CreatingProperty(Type propertyType, string propertyName, object cont
throw new ArgumentNullException(nameof(context));
}

WriteMessage(
FormatAndWriteMessage(
Resources.DefaultBuildLog_CreatingProperty,
propertyName,
propertyType.FullName,
Expand All @@ -195,7 +195,7 @@ public void CreatingType(Type type, Type creatorType, object context)
throw new ArgumentNullException(nameof(creatorType));
}

WriteMessage(Resources.DefaultBuildLog_CreatingType, type.FullName, creatorType.FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_CreatingType, type.FullName, creatorType.FullName);

_indent++;
}
Expand All @@ -215,7 +215,7 @@ public void CreatingValue(Type type, Type generatorType, object context)
throw new ArgumentNullException(nameof(generatorType));
}

WriteMessage(Resources.DefaultBuildLog_CreatingValue, type.FullName, generatorType.FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_CreatingValue, type.FullName, generatorType.FullName);
}

/// <inheritdoc />
Expand All @@ -239,7 +239,7 @@ public void IgnoringProperty(Type propertyType, string propertyName, object cont
throw new ArgumentNullException(nameof(context));
}

WriteMessage(
FormatAndWriteMessage(
Resources.DefaultBuildLog_IgnoringProperty,
propertyName,
propertyType.FullName,
Expand All @@ -261,7 +261,7 @@ public void MappedType(Type source, Type target)
throw new ArgumentNullException(nameof(target));
}

WriteMessage(Resources.DefaultBuildLog_MappingType, source.FullName, target.FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_MappingType, source.FullName, target.FullName);
}

/// <inheritdoc />
Expand All @@ -275,7 +275,7 @@ public void PopulatedInstance(object instance)

_indent--;

WriteMessage(Resources.DefaultBuildLog_PopulatedInstance, instance.GetType().FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_PopulatedInstance, instance.GetType().FullName);
}

/// <inheritdoc />
Expand All @@ -287,7 +287,7 @@ public void PopulatingInstance(object instance)
throw new ArgumentNullException(nameof(instance));
}

WriteMessage(Resources.DefaultBuildLog_PopulatingInstance, instance.GetType().FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_PopulatingInstance, instance.GetType().FullName);

_indent++;
}
Expand All @@ -307,7 +307,7 @@ public void PostBuildAction(Type type, Type postBuildType, object context)
throw new ArgumentNullException(nameof(postBuildType));
}

WriteMessage(Resources.DefaultBuildLog_PostBuild, type.FullName, postBuildType.FullName);
FormatAndWriteMessage(Resources.DefaultBuildLog_PostBuild, type.FullName, postBuildType.FullName);
}

/// <summary>
Expand All @@ -320,7 +320,7 @@ protected virtual void WriteMessage(string message)
_builder.AppendLine();
}

private void WriteMessage(string message, params object[] args)
private void FormatAndWriteMessage(string message, params object[] args)
{
Debug.Assert(message != null, "No message has been provided");

Expand Down

0 comments on commit bf311d8

Please sign in to comment.