• Clemens Backes's avatar
    [base] Improve logging for long error messages · 193c08ad
    Clemens Backes authored
    When comparing objects which get printed to very long strings (e.g.
    collections like vectors), it's much more readable if they get printed
    to individual lines. Differences are much easier to spot then.
    
    This CL refactors the CHECK/DCHECK macros to print the left hand side
    and right-hand side in individual lines if any of them is longer than 50
    characters.
    
    To that end, the {PrintCheckOperand} method (only used from
    {MakeCheckOpString}) is changed to return the string directly instead of
    printing to an output stream.
    
    R=mlippautz@chromium.org
    
    Change-Id: I6e24a5cbfeb1af53fa0aca2828e23f642b15569c
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1991866Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#65705}
    193c08ad
logging.cc 5.71 KB