Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Lines get mixed up in the logs because of line breaks!

Kef's Avatar

Kef

14 Aug, 2017 06:14 AM

When using line breaks in the same string, sometimes for some reason the lines get swapped. For example, if I use Console.WriteLine("Line1\r\nLine2"); sometimes I see Line2 before Line1 (doesn't matter if I use \n only or \r\n).
It kinda makes the logs harder to read because of this issue. I'd like to know the reason and whether i can fix it or not.
Thank you in advance!

  1. Support Staff 1 Posted by rune on 18 Aug, 2017 03:02 AM

    rune's Avatar

    Hi,

    I'm not quite sure why this would happen, but I haven't seen it before -- and some log messages will contain line breaks, for instance when logging exceptions. Do you have an example of this that I can take a closer look at?

    Also, is there a particular reason you use Console.WriteLine rather than Console.Write? I suspect you may be able to fix the issue by using the latter, but it's still odd if you're seeing inconsistent behavior for the same log messages regardless of the newline characters you use.

    Best,
    Rune

  2. 2 Posted by Kef on 18 Aug, 2017 09:47 AM

    Kef's Avatar

    See the attached files for an example of that I mean.

    Also, do you mean that I should use `Console.Write` instead? I don't think it matters since the string itself has line breaks. I even tried `Environment.NewLine` property (though i'm pretty sure either \n or \r\n would work fine)

    Thank you

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac