J-Link RTT Viewer, save or copy log WITH colors

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • J-Link RTT Viewer, save or copy log WITH colors

      The RTT Viewer supports colored text output, which is a great feature to easily distinguish between certain classes of log information.
      segger.com/products/debug-probes/j-link/tools/rtt-viewer/
      E.g. the Nordic SDK can use NRF_LOG_ERROR and NRF_LOG_WARNING log functions with individual colors.

      For rather long log files I want to archive the text from RTT Viewer into a file.
      But I see no possibility to keep the color information with my text file. Neither the clipboard nor the file written with the "Terminal Logging"
      contains any color information.

      Screen shots are no solution, between the log may be hundreds of lines of text.
      Is there a way to keep the color information ?
    • Hi,
      Thank you for your inquiry.

      Currently, this is not possible.
      In general, text files and similar do not come with text color information.
      Probably the easiest way would be for you to work with identifiers and indentation to make the calls more visible.
      Example:

      Source Code

      1. <FuncName>:
      2. Text1
      3. Text2
      4. <FuncEnd>
      5. <FuncName2>:
      6. ..
      7. ..
      I will check if we can somehow improve our handling for colored texts.
      Keep you posted.

      Best regards,
      Fabian
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/


      Or you can contact us via e-mail.
    • I could think about rich-text-format (rtf) output or HTML as an option for streaming to out files. This would allow colored text.
      For rtf of course an editor with rtf support would need to be used but there are quite some out there ;)
    • I think writing the file in different formats like RTF or HTML would make the existing file-logging function a bit complex.

      If implementing a copy / paste (clipboard) with colors there could be two approaches:

      1)
      An easy method would be to provide different modes for the (context) menu "Copy" command.
      For example the ConEmu Windows Terminal (conemu.github.io/en/Downloads.html)
      supports copying colored text from its command windows.
      You can check a "Copy as HTML" option in the menu near the Select all and Copy commands.
      And if checked all subsequent Copy commands will put the colored text as HTML into the clipboard.
      "Plain text" is the default, just as RTTView does it now.

      2)
      The more generic approach would be the standard Windows clipboard features.
      An application "offers" different formats to the clipboard which it CAN supply, if they are requested.
      The client application can see, which clipboard formats are available and then choose which one it would like to have.
      Example: if I use MS OneNote to copy some text/data, the clipboard shows several available formats including
      CF_TEXT
      CF_UNICODETEXT
      HTML_FORMAT
      One Note Internal

      This can be seen with eg. Nirsoft / InsideClipboard.
      The advantage with this method is that the user interface of RTTViewer would not have to be changed at all.

      The post was edited 1 time, last by Rodims18 ().