Skip to content

Commit

Permalink
Improve correction and source enum value name logging (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
gyk4j authored Mar 12, 2024
1 parent a7a86bf commit 779efd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Wreck/Logging/Dumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ public static void Dump<K,V>(IDictionary<K, V> values)
{
foreach(KeyValuePair<K, V> entry in values)
{
Type type = entry.Key.GetType();
string key = type.IsEnum?
Enum.GetName(type, entry.Key):
entry.Key.ToString();

LOG.DebugFormat(
"{0} = {1}",
entry.Key.ToString(),
key,
entry.Value.ToString());
}
}
Expand Down
5 changes: 5 additions & 0 deletions Wreck/Resources/CorrectionEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@ public string Description
this.name = name;
this.description = description;
}

public override string ToString()
{
return Name;
}
}
}
5 changes: 5 additions & 0 deletions Wreck/Resources/SourceEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@ public string Description
this.name = name;
this.description = description;
}

public override string ToString()
{
return Name;
}
}
}

0 comments on commit 779efd3

Please sign in to comment.