Class LogUtil

  • Direct Known Subclasses:
    LogUtil

    public class LogUtil
    extends Object
    Class that provides logging representations for most of TeamCity objects
    Author:
    Yegor.Yarko, Eugene.Petrenko
    • Constructor Detail

      • LogUtil

        public LogUtil()
    • Method Detail

      • quote

        @NotNull
        public static String quote​(@Nullable
                                   String text)
        Quote the text (such as id) for logging or presentation to the user in messages.
        Parameters:
        text - text to quote
        Returns:
        quoted text
      • describe

        @NotNull
        public static String describe​(@Nullable
                                      Object o)
      • describe

        @NotNull
        public static String describe​(@Nullable
                                      Date date)
      • describe

        @NotNull
        public static <T> String describe​(@Nullable
                                          Collection<T> collection,
                                          @NotNull
                                          String separator,
                                          @NotNull
                                          String prefix,
                                          @NotNull
                                          String suffix,
                                          int limitItems)
        Returns a string representation of a collection of Loggable items, with given limit. May be used in logs when a collection with potentially large number of items should be logged.
        Parameters:
        limitItems - up to this number of items will be logged, if there are more, count of items in collection will be appended
        Since:
        2020.1