Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/AutoRest.Core/Logging/ConsoleLogListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void Log(LogMessage message)
targetStream.WriteLine($"{message.Severity.ToString().ToUpperInvariant()}: {message.Message}");
if (message.Path != null)
{
targetStream.WriteLine($"\tPath: {message.Path.XPath}");
targetStream.WriteLine($"\tPath: {message.Path.ReadablePath}");
}
if (message.VerboseData != null)
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/AutoRest.Core/Logging/ObjectPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ private ObjectPath(IEnumerable<ObjectPathPart> path)

public string XPath => "#" + string.Concat(Path.Select(p => p.XPath));

public string ReadablePath => "#" + string.Concat(Path.Select(p => p.ReadablePath));

public YamlNode SelectNode(YamlNode node)
{
YamlNode result = node;
Expand Down
2 changes: 2 additions & 0 deletions src/core/AutoRest.Core/Logging/ObjectPathPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public abstract class ObjectPathPart
{
public abstract string XPath { get; }

public abstract string ReadablePath { get; }

/// <summary>
/// Selects the child node according to this path part.
/// Returns null if such node was not found.
Expand Down
2 changes: 2 additions & 0 deletions src/core/AutoRest.Core/Logging/ObjectPathPartIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public ObjectPathPartIndex(int index)

public override string XPath => $"[{Index + 1}]";

public override string ReadablePath => XPath;

public override YamlNode SelectNode(ref YamlNode node)
{
var snode = node as YamlSequenceNode;
Expand Down
2 changes: 2 additions & 0 deletions src/core/AutoRest.Core/Logging/ObjectPathPartProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public ObjectPathPartProperty(string property)

public override string XPath => $"/{SanitizeXPathProperty(Property)}";

public override string ReadablePath => Property.StartsWith("/") ? Property : $"/{Property}";

public override YamlNode SelectNode(ref YamlNode node)
{
var child = (node as YamlMappingNode)?.
Expand Down