[cmake-developers] [PATCH] stage/compact-status-log

Adam Strzelecki ono at java.pl
Sun Sep 21 12:45:24 EDT 2014


I have pushed new branch stage/compact-status-log for review.

Idea behind is to reduce cmake output when we are in terminal. When we are outputting message "Trying feature" we can later remove it when new output comes using ANSI escape codes. This is done by appending (but not flushing) \e[9999D\e[K to stdout. Once new status comes and flushes stdout (explicitly or implicitly by \n) these codes will be executed and will clear the line, so we get:

	Trying some feature - success
    
Instead of:
    
	Trying some feature
	Trying some feature - success

NOTE this behavior only applies to terminal (isatty check), so when piping cmake output to file is works as before.

Waiting for your feedback.

--Adam

commit 224a515538f9574af80bb8a2d28525a44039ead7
Author: Adam Strzelecki <ono at java.pl>
Date:   Sun Sep 21 18:29:33 2014 +0200

    Use message(CLEAR "...") when starting checks
    
    This emits more compact logs when cmake is running in terminal.

commit 61b57ec4549606bcafdfc2f5579c570ab8644b53
Author: Adam Strzelecki <ono at java.pl>
Date:   Sun Sep 21 18:22:40 2014 +0200

    message(...) function now accepts CLEAR keyword
    
    Status text emitted with message(CLEAR "...") will be immediately cleared when
    next stdout output arrives. This ensures we get more compact message logs, e.g.:
    
      Trying some feature - success
    
    Instead of:
    
      Trying some feature
      Trying some feature - success



More information about the cmake-developers mailing list