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


Java InternalLogLevel类代码示例

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


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

示例1: logMethodCall

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
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");
}
 
开发者ID:yajsw,项目名称:yajsw,代码行数:19,代码来源:MetaClassHelper.java

示例2: fromInternal

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
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;
    }
}
 
开发者ID:MrGregorix,项目名称:SlackDiscordBridge,代码行数:19,代码来源:NettyLog4j2Logger.java

示例3: isEnabled

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@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;
}
 
开发者ID:WenZuHuai,项目名称:light-task-scheduler,代码行数:20,代码来源:NettyLogger.java

示例4: log

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@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;
    }
}
 
开发者ID:WenZuHuai,项目名称:light-task-scheduler,代码行数:24,代码来源:NettyLogger.java

示例5: SpdyFrameLogger

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
public SpdyFrameLogger(InternalLogLevel level) {
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = InternalLoggerFactory.getInstance(getClass());
    this.level = level;
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:9,代码来源:SpdyFrameLogger.java

示例6: LoggingHandler

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
/**
 * 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,代码行数:16,代码来源:LoggingHandler.java

示例7: exceptionCaught

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@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,代码行数:36,代码来源:CommandHandler.java

示例8: operationComplete

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@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,代码行数:36,代码来源:CommandHandler.java

示例9: getLogLevel

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
public final InternalLogLevel getLogLevel() {
	return logLevel;
}
 
开发者ID:juebanlin,项目名称:util4j,代码行数:4,代码来源:AbstractNettyClient.java

示例10: setLogLevel

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
public final void setLogLevel(InternalLogLevel logLevel) {
	if(logLevel!=null)
	{
		this.logLevel = logLevel;
	}
}
 
开发者ID:juebanlin,项目名称:util4j,代码行数:7,代码来源:AbstractNettyClient.java

示例11: isEnabled

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@Override
public boolean isEnabled(final InternalLogLevel level)
{
    return logger.isEnabled(fromInternal(level));
}
 
开发者ID:MrGregorix,项目名称:SlackDiscordBridge,代码行数:6,代码来源:NettyLog4j2Logger.java

示例12: log

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@Override
public void log(final InternalLogLevel level, final String msg)
{
    logger.log(fromInternal(level), msg);
}
 
开发者ID:MrGregorix,项目名称:SlackDiscordBridge,代码行数:6,代码来源:NettyLog4j2Logger.java

示例13: run

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
/**
 * 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,代码行数:72,代码来源:ConnectionWatchdog.java

示例14: isEnabled

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@Override
public boolean isEnabled(InternalLogLevel level) {
    return delegate.isEnabled(level);
}
 
开发者ID:Tesora,项目名称:tesora-dve-pub,代码行数:5,代码来源:NettyLeakIntercept.java

示例15: log

import io.netty.util.internal.logging.InternalLogLevel; //导入依赖的package包/类
@Override
public void log(InternalLogLevel level, String msg) {
    if (level == InternalLogLevel.ERROR)
        incrementLeak();
    delegate.log(level, msg);
}
 
开发者ID:Tesora,项目名称:tesora-dve-pub,代码行数:7,代码来源:NettyLeakIntercept.java


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