Java 类io.netty.util.internal.logging.InternalLogLevel 实例源码

项目:yajsw    文件:MetaClassHelper.java   
public static void logMethodCall(Object object, String methodName, Object[] arguments) {
    String className = getClassName(object);
    String logname = "methodCalls." + className + "." + methodName;
    InternalLogger objLog = InternalLoggerFactory.getInstance(logname);
    if (!objLog.isTraceEnabled()) return;
    StringBuilder msg = new StringBuilder(methodName);
    msg.append("(");
    if (arguments != null) {
        for (int i = 0; i < arguments.length;) {
            msg.append(normalizedValue(arguments[i]));
            if (++i < arguments.length) {
                msg.append(",");
            }
        }
    }
    msg.append(")");
    objLog.log(InternalLogLevel.TRACE, className, msg.toString(), "called from MetaClass.invokeMethod");
}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
private Level fromInternal(final InternalLogLevel level)
{
    switch (level)
    {
        case TRACE:
            return Level.TRACE;
        case DEBUG:
            return Level.DEBUG;
        case INFO:
            return Level.INFO;
        case WARN:
            return Level.WARN;
        case ERROR:
            return Level.ERROR;
        default:
            return null;
    }
}
项目:light-task-scheduler    文件:NettyLogger.java   
@Override
public boolean isEnabled(InternalLogLevel level) {
    if (level == null) {
        return false;
    }
    switch (level) {
        case TRACE:
            return logger.isTraceEnabled();
        case DEBUG:
            return logger.isDebugEnabled();
        case INFO:
            return logger.isInfoEnabled();
        case WARN:
            return logger.isWarnEnabled();
        case ERROR:
            return logger.isErrorEnabled();
    }
    return false;
}
项目:light-task-scheduler    文件:NettyLogger.java   
@Override
public void log(InternalLogLevel level, String msg) {
    if (level == null) {
        return;
    }
    switch (level) {
        case TRACE:
            trace(msg);
            break;
        case DEBUG:
            debug(msg);
            break;
        case INFO:
            info(msg);
            break;
        case WARN:
            warn(msg);
            break;
        case ERROR:
            error(msg);
            break;
    }
}
项目:light-task-scheduler    文件:NettyLogger.java   
@Override
public void log(InternalLogLevel level, String format, Object arg) {
    if (level == null) {
        return;
    }
    switch (level) {
        case TRACE:
            trace(format, arg);
            break;
        case DEBUG:
            debug(format, arg);
            break;
        case INFO:
            info(format, arg);
            break;
        case WARN:
            warn(format, arg);
            break;
        case ERROR:
            error(format, arg);
            break;
    }
}
项目:light-task-scheduler    文件:NettyLogger.java   
@Override
public void log(InternalLogLevel level, String format, Object argA, Object argB) {
    if (level == null) {
        return;
    }
    switch (level) {
        case TRACE:
            trace(format, argA, argB);
            break;
        case DEBUG:
            debug(format, argA, argB);
            break;
        case INFO:
            info(format, argA, argB);
            break;
        case WARN:
            warn(format, argA, argB);
            break;
        case ERROR:
            error(format, argA, argB);
            break;
    }
}
项目:light-task-scheduler    文件:NettyLogger.java   
@Override
public void log(InternalLogLevel level, String format, Object... arguments) {
    if (level == null) {
        return;
    }
    switch (level) {
        case TRACE:
            trace(format, arguments);
            break;
        case DEBUG:
            debug(format, arguments);
            break;
        case INFO:
            info(format, arguments);
            break;
        case WARN:
            warn(format, arguments);
            break;
        case ERROR:
            error(format, arguments);
            break;
    }
}
项目:light-task-scheduler    文件:NettyLogger.java   
@Override
public void log(InternalLogLevel level, String msg, Throwable t) {
    if (level == null) {
        return;
    }
    switch (level) {
        case TRACE:
            trace(msg, t);
            break;
        case DEBUG:
            debug(msg, t);
            break;
        case INFO:
            info(msg, t);
            break;
        case WARN:
            warn(msg, t);
            break;
        case ERROR:
            error(msg, t);
            break;
    }
}
项目:JavaAyo    文件:SpdyFrameLogger.java   
public SpdyFrameLogger(InternalLogLevel level) {
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = InternalLoggerFactory.getInstance(getClass());
    this.level = level;
}
项目:netty4.0.27Learn    文件:SpdyFrameLogger.java   
public SpdyFrameLogger(InternalLogLevel level) {
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = InternalLoggerFactory.getInstance(getClass());
    this.level = level;
}
项目:netty.book.kor    文件:LoggingHandler.java   
/**
 * Creates a new instance whose logger name is the fully qualified class
 * name of the instance.
 *
 * @param level the log level
 */
public LoggingHandler(LogLevel level) {
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = InternalLoggerFactory.getInstance(getClass());
    this.level = level;
    internalLevel = InternalLogLevel.DEBUG;
}
项目:netty.book.kor    文件:LoggingHandler.java   
/**
 * Creates a new instance with the specified logger name.
 *
 * @param clazz the class type to generate the logger for
 * @param level the log level
 */
public LoggingHandler(Class<?> clazz, LogLevel level) {
    if (clazz == null) {
        throw new NullPointerException("clazz");
    }
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = InternalLoggerFactory.getInstance(clazz);
    this.level = level;
    internalLevel = InternalLogLevel.DEBUG;
}
项目:netty.book.kor    文件:LoggingHandler.java   
/**
 * Creates a new instance with the specified logger name.
 *
 * @param name the name of the class to use for the logger
 * @param level the log level
 */
public LoggingHandler(String name, LogLevel level) {
    if (name == null) {
        throw new NullPointerException("name");
    }
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = InternalLoggerFactory.getInstance(name);
    this.level = level;
    internalLevel = InternalLogLevel.DEBUG;
}
项目:lettuce-core    文件:CommandHandler.java   
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {

    InternalLogLevel logLevel = InternalLogLevel.WARN;

    if (!stack.isEmpty()) {
        RedisCommand<K, V, ?> command = stack.poll();
        if (debugEnabled) {
            logger.debug("{} Storing exception in {}", logPrefix(), command);
        }
        logLevel = InternalLogLevel.DEBUG;
        try {
            command.completeExceptionally(cause);
        } catch (Exception ex) {
            logger.warn("{} Unexpected exception during command completion exceptionally: {}", logPrefix, ex.toString(), ex);
        }
    }

    if (channel == null || !channel.isActive() || !isConnected()) {
        if (debugEnabled) {
            logger.debug("{} Storing exception in connectionError", logPrefix());
        }
        logLevel = InternalLogLevel.DEBUG;
        connectionError = cause;
    }

    if (cause instanceof IOException && logLevel.ordinal() > InternalLogLevel.INFO.ordinal()) {
        logLevel = InternalLogLevel.INFO;
        if (SUPPRESS_IO_EXCEPTION_MESSAGES.contains(cause.getMessage())) {
            logLevel = InternalLogLevel.DEBUG;
        }
    }

    logger.log(logLevel, "{} Unexpected exception during request: {}", logPrefix, cause.toString(), cause);
}
项目:lettuce-core    文件:CommandHandler.java   
@SuppressWarnings("unchecked")
@Override
public void operationComplete(Future<Void> future) throws Exception {

    Throwable cause = future.cause();

    boolean success = future.isSuccess();
    dequeue();

    if (!success) {
        if (cause instanceof EncoderException || cause instanceof Error || cause.getCause() instanceof Error) {
            complete(cause);
            return;
        }

        Channel channel = CommandHandler.this.channel;
        if (channel != null) {
            channel.eventLoop().submit(this::requeueCommands);
        } else {
            CommandHandler.this.clientResources.eventExecutorGroup().submit(this::requeueCommands);
        }
    }

    if (!success && !(cause instanceof ClosedChannelException)) {

        String message = "Unexpected exception during request: {}";
        InternalLogLevel logLevel = InternalLogLevel.WARN;

        if (cause instanceof IOException && SUPPRESS_IO_EXCEPTION_MESSAGES.contains(cause.getMessage())) {
            logLevel = InternalLogLevel.DEBUG;
        }

        logger.log(logLevel, message, cause.toString(), cause);
    }
}
项目:util4j    文件:AbstractNettyClient.java   
public final InternalLogLevel getLogLevel() {
    return logLevel;
}
项目:util4j    文件:AbstractNettyClient.java   
public final void setLogLevel(InternalLogLevel logLevel) {
    if(logLevel!=null)
    {
        this.logLevel = logLevel;
    }
}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
@Override
public boolean isEnabled(final InternalLogLevel level)
{
    return logger.isEnabled(fromInternal(level));
}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String msg)
{
    logger.log(fromInternal(level), msg);
}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String format, final Object arg)
{
    logger.log(fromInternal(level), format, arg);
}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String format, final Object argA, final Object argB)
{
    logger.log(fromInternal(level), format, argA, argB);

}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String format, final Object... arguments)
{
    logger.log(fromInternal(level), format, arguments);
}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String msg, final Throwable t)
{
    logger.log(fromInternal(level), msg, t);

}
项目:SlackDiscordBridge    文件:NettyLog4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final Throwable t)
{
    logger.log(fromInternal(level), t);
}
项目:lettuce-core    文件:ConnectionWatchdog.java   
/**
 * Reconnect to the remote address that the closed channel was connected to. This creates a new {@link ChannelPipeline} with
 * the same handler instances contained in the old channel's pipeline.
 *
 * @param timeout Timer task handle.
 *
 * @throws Exception when reconnection fails.
 */
@Override
public void run(Timeout timeout) throws Exception {

    reconnectSchedulerSync.set(false);
    reconnectScheduleTimeout = null;

    if (!isEventLoopGroupActive()) {
        logger.debug("isEventLoopGroupActive() == false");
        return;
    }

    if (commandHandler != null && commandHandler.isClosed()) {
        logger.debug("Skip reconnect scheduling, CommandHandler is closed");
        return;
    }

    if (isReconnectSuspended()) {
        logger.debug("Skip reconnect scheduling, reconnect is suspended");
        return;
    }

    boolean shouldLog = shouldLog();

    InternalLogLevel infoLevel = InternalLogLevel.INFO;
    InternalLogLevel warnLevel = InternalLogLevel.WARN;

    if (shouldLog) {
        lastReconnectionLogging = System.currentTimeMillis();
    } else {
        warnLevel = InternalLogLevel.DEBUG;
        infoLevel = InternalLogLevel.DEBUG;
    }

    InternalLogLevel warnLevelToUse = warnLevel;

    try {
        reconnectionListener.onReconnect(new ConnectionEvents.Reconnect(attempts));
        logger.log(infoLevel, "Reconnecting, last destination was {}", remoteAddress);

        ChannelFuture future = reconnectionHandler.reconnect();

        future.addListener(it -> {

            if (it.isSuccess() || it.cause() == null) {
                return;
            }

            Throwable throwable = it.cause();

            if (ReconnectionHandler.isExecutionException(throwable)) {
                logger.log(warnLevelToUse, "Cannot reconnect: {}", throwable.toString());
            } else {
                logger.log(warnLevelToUse, "Cannot reconnect: {}", throwable.toString(), throwable);
            }

            if (!isReconnectSuspended()) {
                scheduleReconnect();
            }
        });
    } catch (Exception e) {
        logger.log(warnLevel, "Cannot reconnect: {}", e.toString());
    }
}
项目:tesora-dve-pub    文件:NettyLeakIntercept.java   
@Override
public boolean isEnabled(InternalLogLevel level) {
    return delegate.isEnabled(level);
}
项目:tesora-dve-pub    文件:NettyLeakIntercept.java   
@Override
public void log(InternalLogLevel level, String msg) {
    if (level == InternalLogLevel.ERROR)
        incrementLeak();
    delegate.log(level, msg);
}
项目:tesora-dve-pub    文件:NettyLeakIntercept.java   
@Override
public void log(InternalLogLevel level, String format, Object arg) {
    if (level == InternalLogLevel.ERROR)
        incrementLeak();
    delegate.log(level, format, arg);
}
项目:tesora-dve-pub    文件:NettyLeakIntercept.java   
@Override
public void log(InternalLogLevel level, String format, Object argA, Object argB) {
    if (level == InternalLogLevel.ERROR)
        incrementLeak();
    delegate.log(level, format, argA, argB);
}
项目:tesora-dve-pub    文件:NettyLeakIntercept.java   
@Override
public void log(InternalLogLevel level, String format, Object... arguments) {
    if (level == InternalLogLevel.ERROR)
        incrementLeak();
    delegate.log(level, format, arguments);
}
项目:tesora-dve-pub    文件:NettyLeakIntercept.java   
@Override
public void log(InternalLogLevel level, String msg, Throwable t) {
    if (level == InternalLogLevel.ERROR)
        incrementLeak();
    delegate.log(level, msg, t);
}
项目:dnd    文件:Log4j2Logger.java   
@Override
public boolean isEnabled(final InternalLogLevel level) {
    return logger.isEnabled(INTERNAL_TO_LOG4J2_LEVEL.get(level));
}
项目:dnd    文件:Log4j2Logger.java   
@Override
public void log(final InternalLogLevel level, String msg) {
    logger.log(INTERNAL_TO_LOG4J2_LEVEL.get(level), msg);
}
项目:dnd    文件:Log4j2Logger.java   
@Override
public void log(final InternalLogLevel level, String format, Object arg) {
    logger.log(INTERNAL_TO_LOG4J2_LEVEL.get(level), format, arg);
}
项目:dnd    文件:Log4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String format, Object argA, Object argB) {
    logger.log(INTERNAL_TO_LOG4J2_LEVEL.get(level), format, argA, argB);
}
项目:dnd    文件:Log4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String format, Object... arguments) {
    logger.log(INTERNAL_TO_LOG4J2_LEVEL.get(level), format, arguments);
}
项目:dnd    文件:Log4j2Logger.java   
@Override
public void log(final InternalLogLevel level, final String msg, final Throwable t) {
    logger.log(INTERNAL_TO_LOG4J2_LEVEL.get(level), msg, t);
}