Append a line to the log output, indenting this log entry according to tree structure.

@param timeStampStr
the timestamp string
@param indentLevel
the indent level
@param line
the line to log
@param buf
the buf
16430
private void appendLine(final String timeStampStr, final int indentLevel, final String line,
            final StringBuilder buf) {
        buf.append(timeStampStr);
        buf.append('\t');
        buf.append(ClassGraph.class.getSimpleName());
        buf.append('\t');
        final int numDashes = 2 * (indentLevel - 1);
        for (int i = 0; i < numDashes; i++) {
            buf.append('-');
        }
        if (numDashes > 0) {
            buf.append(' ');
        }
        buf.append(line);
        buf.append('\n');
    }
22472
def write(self, buf):
        '''
        
        '''
        for line in buf.rstrip().splitlines():
            self.orig_stdout.write(line.rstrip() + '\n')
            self.orig_stdout.flush()
            try:
                self.logger.log(self.log_level, line.rstrip())
            except Exception as e:
                pass
1289625
protected static void indent(StringBuilder buffer, int number, String character) {
		for (int i = 0; i < number; ++i) {
			buffer.append(character);
		}
	}
561329
protected function echoLine($line, $depth, $indentPad)
    {
        if (-1 !== $depth) {
            fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n");
        }
    }
966054
public static void printStackTrace(final Logger logger, final LogLevel logLevel) {
        printStackTrace((String) null, logger, logLevel);
    }
1371931
public void logHardLink(String src, String dst, long timestamp) {
    HardLinkOp op = HardLinkOp.getInstance();
    op.set(src, dst, timestamp);
    logEdit(op);
  }
1048391
public void log(Level level, Object... elements) {
		if(willWrite.compareTo(level)<=0) {
			StringBuilder sb = buildLine(level, new StringBuilder(),elements);
			if(context==null) {
				System.out.println(sb.toString());
			} else {
				context.log(sb.toString());
			}
		}
	}
925421
public void setIndent(Integer indent) {
		if (indent == null) {
			remove(OutputKeys.INDENT);
			remove(INDENT_AMT);
			return;
		}

		if (indent < 0) {
			throw Messages.INSTANCE.getIllegalArgumentException(11);
		}

		put(OutputKeys.INDENT, "yes");
		put(INDENT_AMT, indent.toString());
	}
1322946
protected void beforeMarkup() {
        int soFar = stack[depth];
        if ((soFar & WROTE_DATA) == 0 // no data in this scope
                && (depth > 0 || soFar != 0)) {
            try {
                writeNewLine(depth);
                if (depth > 0 && getIndent().length() > 0) {
                    afterMarkup(); // indentation was written
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
1142664
public static void log(int logLevel, String msg, Throwable tr) {
    assertInitialization();
    sLogger.log(logLevel, msg, tr);
  }
457720
private void log(Level level, String content, Throwable throwable) {
        String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());
        String log = String.format("[%s] %s [] - %s", level, dateStr, content);
        if(level.isLessSpecificThan(Level.ERROR)
                && level.isMoreSpecificThan(Level.OFF)) {
            System.err.println(log);
        } else {
            System.out.println(log);
        }

        if (throwable != null) {
            throwable.printStackTrace(System.err);
        }
    }
866579
protected void writeIndent() throws IOException {
		final int start = writeLineSepartor ? 0 : offsetNewLine;
		final int level = (depth > maxIndentLevel) ? maxIndentLevel : depth;
		out.write(indentationBuf, start, ((level - 1) * indentationJump) + offsetNewLine);
	}
1134009
function writeLog(level, msg) {
  var line;
  if(showSourceInfo) {
    var si = getSourceInfo();
    if (includeDate) {
      line = util.format("[%s] <%s>\t[%s:%s] %s", moment().format(), level, si.file, si.lineNumber, msg);
    } else {
      line = util.format("<%s>\t[%s:%s] %s", level, si.file, si.lineNumber, msg);
    }
  } else {
    if (includeDate) {
      line = util.format("[%s] <%s>\t%s", moment().format(), level, msg);
    } else {
      line = util.format("<%s>\t%s", level, msg);
    }
  }

  line += '\n';
  appenders.forEach(function(appender) {
    appender(level, line);
  });
}
957400
private function writeListing( array $elements, int $indentLevel, string $lineChar ) : void
	{
		if ( 0 === count( $elements ) )
		{
			return;
		}

		$indent = str_repeat( ' ', $indentLevel * 2 );

		$this->write(
			"%s%s %s  \n\n",
			$indent,
			$lineChar,
			implode( "  \n{$indent}{$lineChar} ", $elements )
		);
	}
1118788
function log(fn, args, indent) {
    if (args.length === 0) {
        return;
    }

    // Assumes args are something you would pass into console.log
    // Applies appropriate nesting
    const indentation = _.repeat('\t', indent);

    // Prepend tabs to first arg (if string)
    if (_.isString(args[0])) {
        args[0] = indentation + args[0];
    } else {
        args.splice(0, 0, indentation);
    }

    fn.apply(this, args);
}
400666
private void appendDetailedString(int level, StringBuilder stringBuilder) {
    String pad = Strings.repeat("--", level);
    stringBuilder.append(pad).append(this).append(SystemUtils.LINE_SEPARATOR);
    for (ProductPartitionNode childNode : getChildren()) {
      childNode.appendDetailedString(level + 1, stringBuilder);
    }
  }
1301435
private void recursiveLogResult(StringBuilder buf, Hierarchy<Result> hier, Result result, int depth) {
    if(result == null) {
      buf.append("null");
      LOG.warning("null result!");
      return;
    }
    if(depth > 50) {
      LOG.warning("Probably infinitely nested results, aborting!");
      return;
    }
    for(int i = 0; i < depth; i++) {
      buf.append(' ');
    }
    buf.append(result.getClass().getSimpleName()).append(": ").append(result.getLongName()) //
        .append(" (").append(result.getShortName()).append(")\n");
    if(hier.numChildren(result) > 0) {
      for(It<Result> iter = hier.iterChildren(result); iter.valid(); iter.advance()) {
        recursiveLogResult(buf, hier, iter.get(), depth + 1);
      }
    }
  }