本文整理汇总了Java中org.apache.logging.log4j.simple.SimpleLogger类的典型用法代码示例。如果您正苦于以下问题:Java SimpleLogger类的具体用法?Java SimpleLogger怎么用?Java SimpleLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimpleLogger类属于org.apache.logging.log4j.simple包,在下文中一共展示了SimpleLogger类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getLevel
import org.apache.logging.log4j.simple.SimpleLogger; //导入依赖的package包/类
public static org.apache.logging.log4j.Level getLevel(org.apache.logging.log4j.Logger logger) {
if(logger instanceof org.apache.logging.log4j.core.Logger) {
return ((org.apache.logging.log4j.core.Logger) logger).getLevel();
} else if(logger instanceof SimpleLogger) {
return ((SimpleLogger) logger).getLevel();
} else {
return null;
}
}
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:10,代码来源:Logging.java
示例2: setLevel
import org.apache.logging.log4j.simple.SimpleLogger; //导入依赖的package包/类
public static void setLevel(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level) {
if(logger instanceof org.apache.logging.log4j.core.Logger) {
((org.apache.logging.log4j.core.Logger) logger).setLevel(level);
} else if(logger instanceof SimpleLogger) {
((SimpleLogger) logger).setLevel(level);
}
}
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:8,代码来源:Logging.java
示例3: setLevel
import org.apache.logging.log4j.simple.SimpleLogger; //导入依赖的package包/类
public void setLevel(String level) {
Level new_level=strToLevel(level);
if(new_level == null)
return;
if(logger instanceof org.apache.logging.log4j.core.Logger)
((org.apache.logging.log4j.core.Logger)logger).setLevel(new_level);
else if(logger instanceof SimpleLogger)
((SimpleLogger)logger).setLevel(new_level);
}
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:10,代码来源:Log4J2LogImpl.java
示例4: main
import org.apache.logging.log4j.simple.SimpleLogger; //导入依赖的package包/类
public static void main() {
PrintStream ps = new PrintStream(new FileOutputStream(FileDescriptor.out));
MyTown.instance = new MyTown();
MyTown.instance.LOG = new SimpleLogger("MyTown2-Test", Level.INFO, true, true, false, false, "DD/MM/YY", null, PropertiesUtil.getProperties(), ps);
ps = new PrintStream(new FileOutputStream(FileDescriptor.out));
MyEssentialsCore.instance = new MyEssentialsCore();
MyEssentialsCore.instance.LOG = new SimpleLogger("MyEssentials-Core-Test", Level.INFO, true, true, false, false, "DD/MM/YY", null, PropertiesUtil.getProperties(), ps);
}
开发者ID:MyEssentials,项目名称:MyTown2,代码行数:10,代码来源:TestMain.java
示例5: StatusLogger
import org.apache.logging.log4j.simple.SimpleLogger; //导入依赖的package包/类
private StatusLogger(final String name, final MessageFactory messageFactory) {
super(name, messageFactory);
this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, Strings.EMPTY,
messageFactory, PROPS, System.err);
this.listenersLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN).intLevel();
// LOG4J2-1813 if system property "log4j2.debug" is defined, print all status logging
if (isDebugPropertyEnabled()) {
logger.setLevel(Level.TRACE);
}
}
开发者ID:apache,项目名称:logging-log4j2,代码行数:12,代码来源:StatusLogger.java
示例6: StatusLogger
import org.apache.logging.log4j.simple.SimpleLogger; //导入依赖的package包/类
private StatusLogger() {
this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, "", null, PROPS,
System.err);
this.listenersLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN).intLevel();
}
开发者ID:OuZhencong,项目名称:log4j2,代码行数:6,代码来源:StatusLogger.java
注:本文中的org.apache.logging.log4j.simple.SimpleLogger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论