Class TaskLogFormatUtils


  • public class TaskLogFormatUtils
    extends Object
    Utility class to get a pretty printed hierarchical task log.
    • Constructor Detail

      • TaskLogFormatUtils

        public TaskLogFormatUtils()
    • Method Detail

      • getTaskLog

        public static String getTaskLog​(Task task)
        Returns a nicely formatted string showing all the tasks hierarchically.
        Returns:
        returns the task nicely hierarchical formatted
      • getTaskLog

        public static String getTaskLog​(Task task,
                                        int maxDepth)
        Returns a formatted string from the task including its descendant tasks. The log should include descendant tasks only in maxDepth level at max. When maxDepth is set to a negative value, all the descendant tasks will be included.
        Parameters:
        task - the task to log
        maxDepth - the maximum depth until how deep child tasks should be logged. A negative maxDepth value will log all descendant tasks, maxDepth of 0 only the rootTask, maxDepth of 1 the rootTask plus its direct children, etc.
        Returns:
      • getTaskLog

        public static String getTaskLog​(Task task,
                                        int maxDepth,
                                        long subtaskThresholdMillisec)
        Returns a formatted string from the task including its descendant tasks. The log should include descendant tasks only in maxDepth level at max. When maxDepth is set to a negative value, all the descendant tasks will be included. Also, the log should include descendant tasks only a descendant task takes more time than subtaskThresholdMillisec in milliseconds. When subtaskThresholdMillisec is set to a non-negative value, only descendant tasks which take not less time than taskThresholdMillisec will be included.
        Parameters:
        task - the task to log
        maxDepth - the maximum depth until how deep child tasks should be logged. A negative maxDepth value will log all descendant tasks, maxDepth of 0 only the rootTask, maxDepth of 1 the rootTask plus its direct children, etc.
        subtaskThresholdMillisec - the threshold time milliseconds to include logs of subtasks under task.
        Returns: