Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-7269

dsrepl status: add colors to the output

    Details

    • Type: New Feature
    • Status: Dev backlog
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.0.0
    • Fix Version/s: None
    • Component/s: monitoring, replication, tools
    • Labels:
      None

      Description

      dsrepl status outputs quite a lot of health / monitoring information.

      It could be useful to attract the attention of users by showing errors in red and warnings in orange for example.

      Implementation details

      See https://en.wikipedia.org/wiki/ANSI_escape_code#Colors for how to output colors in a terminal. We may have to disable color output for non unix systems (including windows).

      We discussed a few ways to do it:

      • add a --colors argument. Problem: you might forgot to use it by default. Maven implemented a --batch-mode argument so colors are the default, but it is a pain to remember adding this method when redirecting the output.
      • detect if stdout outputs to console, or whether there is a redirection:
        // Only output colors when connected to the terminal: do not output colors in case of redirection
        final boolean useColors = OperatingSystem.isUnixBased() && System.console() != null;
        

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                JnRouvignac Jean-Noël Rouvignac
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: