当前位置: 首页>>代码示例>>Java>>正文


Java InternalLogLevel.DEBUG属性代码示例

本文整理汇总了Java中io.netty.util.internal.logging.InternalLogLevel.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java InternalLogLevel.DEBUG属性的具体用法?Java InternalLogLevel.DEBUG怎么用?Java InternalLogLevel.DEBUG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在io.netty.util.internal.logging.InternalLogLevel的用法示例。


在下文中一共展示了InternalLogLevel.DEBUG属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LoggingHandler

/**
 * 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;
}
 
开发者ID:krisjey,项目名称:netty.book.kor,代码行数:15,代码来源:LoggingHandler.java

示例2: exceptionCaught

@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);
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:35,代码来源:CommandHandler.java

示例3: operationComplete

@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);
    }
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:35,代码来源:CommandHandler.java

示例4: run

/**
 * 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());
    }
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:71,代码来源:ConnectionWatchdog.java


注:本文中的io.netty.util.internal.logging.InternalLogLevel.DEBUG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。