private LogNode addChild ( final String sortKey , final String msg , final long elapsedTimeNanos , final Throwable exception ) { final String newSortKey = sortKeyPrefix + "\t" + ( sortKey == null ? "" : sortKey ) + "\t" + String . format ( "%09d" , sortKeyUniqueSuffix . getAndIncrement ( ) ) ; final LogNode newChild = new LogNode ( newSortKey , msg , elapsedTimeNanos , exception ) ; newChild . parent = this ; // Make the sort key unique, so that log entries are not clobbered if keys are reused; increment unique // suffix with each new log entry, so that ties are broken in chronological order. children . put ( newSortKey , newChild ) ; return newChild ; }
Add a child log node .