APISonar


jdk.nashorn.internal.runtime.logging.DebugLogger.log

> jdk > nashorn > internal > runtime > logging > DebugLogger > log
jdk APIs nashorn APIs internal APIs runtime APIs logging APIs DebugLogger APIs log APIs

Example 1
private static void stacktrace(final DebugLogger logger) {
        if (!PRINT_STACKTRACE) {
            return;
        }
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final PrintStream ps = new PrintStream(baos);
        new Throwable().printStackTrace(ps);
        final String st = baos.toString();
        if (logger == null) {
            err(st);
        } else {
            logger.log(TRACE_LEVEL, st);
        }
    }
Example 2
static Object traceReturn(final DebugLogger logger, final Object value) {
        final String str = "    return" +
                (VOID_TAG.equals(value) ?
                        ";" :
                            " " + stripName(value) + "; // [type=" + (value == null ? "null]" : stripName(value.getClass()) + ']'));
        if (logger == null) {
            err(str);
        } else if (logger.isEnabled()) {
            logger.log(TRACE_LEVEL, str);
        }

        return value;
    }