io.netty.util.internal.logging.InternalLogLevel Java Examples

The following examples show how to use io.netty.util.internal.logging.InternalLogLevel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NettyLogger.java    From light-task-scheduler with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example #2
Source File: NettyLogger.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object... objects) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, objects);
    }
}
 
Example #3
Source File: NettyLogger.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Throwable throwable) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, throwable);
    }
}
 
Example #4
Source File: NettyLogger.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object o, Object o1) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, o, o1);
    }
}
 
Example #5
Source File: NettyLogger.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object o) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, o);
    }
}
 
Example #6
Source File: NettyLogger.java    From rocketmq-read with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Throwable throwable) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, throwable);
    }
}
 
Example #7
Source File: NettyLogger.java    From rocketmq-read with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object... objects) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, objects);
    }
}
 
Example #8
Source File: NettyLogger.java    From rocketmq-read with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object o, Object o1) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, o, o1);
    }
}
 
Example #9
Source File: NettyLogger.java    From rocketmq-read with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object o) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, o);
    }
}
 
Example #10
Source File: NettyLogger.java    From rocketmq-read with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s);
    }
}
 
Example #11
Source File: NettyLogger.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s);
    }
}
 
Example #12
Source File: NettyLogger.java    From light-task-scheduler with Apache License 2.0 6 votes vote down vote up
@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;
    }
}
 
Example #13
Source File: NettyLogger.java    From light-task-scheduler with Apache License 2.0 6 votes vote down vote up
@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;
    }
}
 
Example #14
Source File: NettyLogger.java    From light-task-scheduler with Apache License 2.0 6 votes vote down vote up
@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;
    }
}
 
Example #15
Source File: NettyLogger.java    From rocketmq-4.3.0 with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Throwable throwable) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, throwable);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, throwable);
    }
}
 
Example #16
Source File: NettyLogger.java    From rocketmq-4.3.0 with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object... objects) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, objects);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, objects);
    }
}
 
Example #17
Source File: NettyLogger.java    From rocketmq-4.3.0 with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object o, Object o1) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, o, o1);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, o, o1);
    }
}
 
Example #18
Source File: NettyLogger.java    From rocketmq-4.3.0 with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s, Object o) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s, o);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s, o);
    }
}
 
Example #19
Source File: NettyLogger.java    From rocketmq-4.3.0 with Apache License 2.0 6 votes vote down vote up
@Override
public void log(InternalLogLevel internalLogLevel, String s) {
    if (internalLogLevel.equals(InternalLogLevel.DEBUG)) {
        logger.debug(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.TRACE)) {
        logger.info(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.INFO)) {
        logger.info(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.WARN)) {
        logger.warn(s);
    }
    if (internalLogLevel.equals(InternalLogLevel.ERROR)) {
        logger.error(s);
    }
}
 
Example #20
Source File: NettyLogger.java    From light-task-scheduler with Apache License 2.0 6 votes vote down vote up
@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;
    }
}
 
Example #21
Source File: NettyLogger.java    From light-task-scheduler with Apache License 2.0 6 votes vote down vote up
@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;
    }
}
 
Example #22
Source File: LoggingHandler.java    From netty.book.kor with MIT License 5 votes vote down vote up
/**
 * 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;
}
 
Example #23
Source File: LeakDetectorTestSuite.java    From pravega with Apache License 2.0 5 votes vote down vote up
@Override
public void log(InternalLogLevel level, String msg, Throwable t) {
    this.wrappedLogger.log(level, msg, t);
    if (level == InternalLogLevel.ERROR) {
        Assert.fail(String.format("RESOURCE LEAK: %s (%s)", msg, t));
    }
}
 
Example #24
Source File: LeakDetectorTestSuite.java    From pravega with Apache License 2.0 5 votes vote down vote up
@Override
public void log(InternalLogLevel level, String format, Object... arguments) {
    this.wrappedLogger.log(level, format, arguments);
    if (level == InternalLogLevel.ERROR) {
        Assert.fail("RESOURCE LEAK: " + String.format(format, arguments));
    }
}
 
Example #25
Source File: SpdyFrameLogger.java    From netty4.0.27Learn with Apache License 2.0 5 votes vote down vote up
public SpdyFrameLogger(InternalLogLevel level) {
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = InternalLoggerFactory.getInstance(getClass());
    this.level = level;
}
 
Example #26
Source File: LoggingHandler.java    From netty.book.kor with MIT License 5 votes vote down vote up
/**
 * 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;
}
 
Example #27
Source File: NSLogginHandler.java    From ns4_frame with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new instance with the specified logger name.
 *
 * @param level   the log level
 */
public NSLogginHandler(Class<?> clazz, LogLevel level) {
    if (clazz == null) {
        throw new NullPointerException("clazz");
    }
    if (level == null) {
        throw new NullPointerException("level");
    }
    logger = new NSLogForNetty();
    this.level = level;
    internalLevel = InternalLogLevel.INFO;
}
 
Example #28
Source File: LoggingHandler.java    From netty.book.kor with MIT License 5 votes vote down vote up
/**
 * 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;
}
 
Example #29
Source File: DynamicHttp2FrameLogger.java    From zuul with Apache License 2.0 5 votes vote down vote up
private String toString(ByteBuf buf) {
    if (level == InternalLogLevel.TRACE || buf.readableBytes() <= BUFFER_LENGTH_THRESHOLD) {
        // Log the entire buffer.
        return ByteBufUtil.hexDump(buf);
    }

    // Otherwise just log the first 64 bytes.
    int length = Math.min(buf.readableBytes(), BUFFER_LENGTH_THRESHOLD);
    return ByteBufUtil.hexDump(buf, buf.readerIndex(), length) + "...";
}
 
Example #30
Source File: NSLogginHandler.java    From ns4_frame with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new instance whose logger name is the fully qualified class
 * name of the instance.
 *
 * @param level   the log level
 */
public NSLogginHandler(LogLevel level) {
    if (level == null) {
        throw new NullPointerException("level");
    }

    logger = new NSLogForNetty();
    this.level = level;
    internalLevel = InternalLogLevel.INFO;
}