diff --git a/CHANGELIST.md b/CHANGELIST.md index c77488fc..162a4fb8 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -9,6 +9,9 @@ - Be smarter about checking for zipped logs - Change offset value for HVN discs - Update to DIC 20210601 +- Fix Aaru command normalization +- Handle carriage returns better +- Add logging helper class ### 2.0 (2021-04-23) - Rename DICUI to Media Preservation Frontend (MPF) diff --git a/MPF.Library/Utilities/Logging.cs b/MPF.Library/Utilities/Logging.cs index ebc5b3c2..5b9eb4b0 100644 --- a/MPF.Library/Utilities/Logging.cs +++ b/MPF.Library/Utilities/Logging.cs @@ -77,18 +77,24 @@ namespace MPF.Utilities continue; } - // For all except the last, just keep appending to the builder - if (i < split.Length - 1) + // For the first item, append to anything existing and then write out + if (i == 0) + { + sb.Append(split[i]); + handler?.Invoke(baseClass, sb.ToString()); + sb.Clear(); + } + + // For the last item, just append so it's dealt with the next time + else if (i == split.Length - 1) { sb.Append(split[i]); } - // For the last item, write out and then put the remainder in the builder + // For everything else, directly write out else { - handler?.Invoke(baseClass, sb.ToString()); - sb.Clear(); - sb.Append(split[i]); + handler?.Invoke(baseClass, split[i]); } } }