Java Code Examples for java.util.logging.Logger#logp()

The following examples show how to use java.util.logging.Logger#logp() . 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: TestIsLoggable.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void log(Level level, Logger logger, String message) {
    if (this.toString().startsWith("LOG_")) {
        logger.log(level, message);
    } else if (this.toString().startsWith("LOG1_")) {
        logger.log(level, message, "dummy param");
    } else if (this.toString().startsWith("LOG2_")) {
        logger.log(level, message, new Object[] {"dummy", "param"});
    } else if (this.toString().startsWith("LOG3_")) {
        logger.log(level, message, new Exception("dummy exception"));
    } else if (this.toString().startsWith("LOGP_")) {
        logger.logp(level, "TestCase", "log", message);
    } else if (this.toString().startsWith("LOGP1_")) {
        logger.logp(level, "TestCase", "log", message, "dummy param");
    } else if (this.toString().startsWith("LOGP2_")) {
        logger.logp(level, "TestCase", "log", message,
                new Object[] {"dummy", "param"});
    } else if (this.toString().startsWith("LOGP3_")) {
        logger.logp(level, "TestCase", "log", message,
                new Exception("dummy exception"));
    } else if (this.toString().startsWith("LEV_")) {
        loglevel(level, logger, message);
    }
}
 
Example 2
Source File: TestIsLoggable.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void log(Level level, Logger logger, String message) {
    if (this.toString().startsWith("LOG_")) {
        logger.log(level, message);
    } else if (this.toString().startsWith("LOG1_")) {
        logger.log(level, message, "dummy param");
    } else if (this.toString().startsWith("LOG2_")) {
        logger.log(level, message, new Object[] {"dummy", "param"});
    } else if (this.toString().startsWith("LOG3_")) {
        logger.log(level, message, new Exception("dummy exception"));
    } else if (this.toString().startsWith("LOGP_")) {
        logger.logp(level, "TestCase", "log", message);
    } else if (this.toString().startsWith("LOGP1_")) {
        logger.logp(level, "TestCase", "log", message, "dummy param");
    } else if (this.toString().startsWith("LOGP2_")) {
        logger.logp(level, "TestCase", "log", message,
                new Object[] {"dummy", "param"});
    } else if (this.toString().startsWith("LOGP3_")) {
        logger.logp(level, "TestCase", "log", message,
                new Exception("dummy exception"));
    } else if (this.toString().startsWith("LEV_")) {
        loglevel(level, logger, message);
    }
}
 
Example 3
Source File: TestIsLoggable.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void log(Level level, Logger logger, String message) {
    if (this.toString().startsWith("LOG_")) {
        logger.log(level, message);
    } else if (this.toString().startsWith("LOG1_")) {
        logger.log(level, message, "dummy param");
    } else if (this.toString().startsWith("LOG2_")) {
        logger.log(level, message, new Object[] {"dummy", "param"});
    } else if (this.toString().startsWith("LOG3_")) {
        logger.log(level, message, new Exception("dummy exception"));
    } else if (this.toString().startsWith("LOGP_")) {
        logger.logp(level, "TestCase", "log", message);
    } else if (this.toString().startsWith("LOGP1_")) {
        logger.logp(level, "TestCase", "log", message, "dummy param");
    } else if (this.toString().startsWith("LOGP2_")) {
        logger.logp(level, "TestCase", "log", message,
                new Object[] {"dummy", "param"});
    } else if (this.toString().startsWith("LOGP3_")) {
        logger.logp(level, "TestCase", "log", message,
                new Exception("dummy exception"));
    } else if (this.toString().startsWith("LEV_")) {
        loglevel(level, logger, message);
    }
}
 
Example 4
Source File: TestLogger.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,msg);
}
 
Example 5
Source File: MibLogger.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void debug(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINEST,className,
                    func,msg);
}
 
Example 6
Source File: MibLogger.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, Throwable t) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,t.toString(),t);
}
 
Example 7
Source File: MibLogger.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void error(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.SEVERE,className,
                    func,msg);
}
 
Example 8
Source File: TestLogger.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,msg);
}
 
Example 9
Source File: MibLogger.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,msg);
}
 
Example 10
Source File: MibLogger.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void error(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.SEVERE,className,
                    func,msg);
}
 
Example 11
Source File: MibLogger.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void config(String func, Throwable t) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.CONFIG,className,
                    func,t.toString(),t);
}
 
Example 12
Source File: MibLogger.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, String msg, Throwable t) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,msg,t);
}
 
Example 13
Source File: MibLogger.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,msg);
}
 
Example 14
Source File: JdkLoggerTest.java    From pinpoint with Apache License 2.0 4 votes vote down vote up
@Ignore
@Test
public void test() {
    Logger logger = Logger.getLogger(this.getClass().getName());

    logger.info("tset");

    // formatting is not supported
    logger.log(Level.INFO, "Test %s", "sdfsdf");

    logger.log(Level.INFO, "Test ", new Exception());

    logger.logp(Level.INFO, JdkLoggerTest.class.getName(), "test()", "tsdd");

    // Should not log this because log level for test defined in logging.properties is "fine".
    logger.finest("logged?");

}
 
Example 15
Source File: TestLogger.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void debug(String func, String msg, Throwable t) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINEST,className,
                    func,msg,t);
}
 
Example 16
Source File: TestLogger.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void debug(String func, Throwable t) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINEST,className,
                    func,t.toString(),t);
}
 
Example 17
Source File: TestLogger.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,msg);
}
 
Example 18
Source File: MibLogger.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void error(String func, String msg) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.SEVERE,className,
                    func,msg);
}
 
Example 19
Source File: MibLogger.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void trace(String func, String msg, Throwable t) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINE,className,
                    func,msg,t);
}
 
Example 20
Source File: MibLogger.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void debug(String func, Throwable t) {
    final Logger l = getLogger();
    if (l!=null) l.logp(Level.FINEST,className,
                    func,t.toString(),t);
}