本文整理汇总了Java中com.mendix.logging.ILogNode.debug方法的典型用法代码示例。如果您正苦于以下问题:Java ILogNode.debug方法的具体用法?Java ILogNode.debug怎么用?Java ILogNode.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mendix.logging.ILogNode
的用法示例。
在下文中一共展示了ILogNode.debug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log
import com.mendix.logging.ILogNode; //导入方法依赖的package包/类
public static void log(String lognode, LogLevel loglevel, String message, Throwable e) {
ILogNode logger = Core.getLogger(lognode);
switch (loglevel) {
case Critical:
logger.critical(message,e);
break;
case Warning:
logger.warn(message,e);
break;
case Debug:
logger.debug(message);
break;
case Error:
logger.error(message,e);
break;
case Info:
logger.info(message);
break;
case Trace:
logger.trace(message);
break;
}
}
示例2: publish
import com.mendix.logging.ILogNode; //导入方法依赖的package包/类
@Override
public void publish(LogRecord record)
{
/*
@see java.util.logging.Level;
public static final Level OFF = new Level("OFF", 2147483647, defaultBundle);
public static final Level SEVERE = new Level("SEVERE", 1000, defaultBundle);
public static final Level WARNING = new Level("WARNING", 900, defaultBundle);
public static final Level INFO = new Level("INFO", 800, defaultBundle);
public static final Level CONFIG = new Level("CONFIG", 700, defaultBundle);
public static final Level FINE = new Level("FINE", 500, defaultBundle);
public static final Level FINER = new Level("FINER", 400, defaultBundle);
public static final Level FINEST = new Level("FINEST", 300, defaultBundle);
public static final Level ALL = new Level("ALL", -2147483648, defaultBundle);
*/
if (record.getLevel() == Level.OFF || record.getLevel() == Level.ALL) //These loglevels should not be used inside a log record
return;
ILogNode logNode = Core.getLogger(record.getLoggerName());
int loglevel = record.getLevel().intValue();
if (loglevel < Level.INFO.intValue() && !logNode.isDebugEnabled())
return;
if (loglevel < Level.FINER.intValue() && !logNode.isTraceEnabled())
return;
Throwable ex = record.getThrown();
if (loglevel < Level.FINER.intValue())
logNode.trace(record.getMessage(), ex);
else if (loglevel < Level.INFO.intValue())
logNode.debug(record.getMessage(), ex);
else if (ex != null)
logNode.error(record.getMessage(), ex);
else
logNode.info(record.getMessage());
}