本文整理汇总了Java中org.osgl.logging.LogManager类的典型用法代码示例。如果您正苦于以下问题:Java LogManager类的具体用法?Java LogManager怎么用?Java LogManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogManager类属于org.osgl.logging包,在下文中一共展示了LogManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configureLoggingLevels
import org.osgl.logging.LogManager; //导入依赖的package包/类
private void configureLoggingLevels() {
Map map = config().subSet("log.level");
map.putAll(config().subSet("act.log.level"));
for (Object o : map.entrySet()) {
Map.Entry<String, String> entry = $.cast(o);
String key = entry.getKey();
if (key.startsWith("log.level")) {
key = key.substring("log.level.".length());
} else {
key = key.substring("act.log.level.".length());
}
Logger.Level level = loggerLevelOf(entry.getValue());
E.invalidConfigurationIf(null == level, "Unknown log level: %s", entry.getValue());
Logger logger = LogManager.get(key);
logger.setLevel(level);
}
}
开发者ID:actframework,项目名称:actframework,代码行数:18,代码来源:App.java
示例2: metric
import org.osgl.logging.LogManager; //导入依赖的package包/类
@Override
public Metric metric(String name) {
if (!Act.appConfig().metricEnabled()) {
return Metric.NULL_METRIC;
}
Logger logger = enabledMap.get(name);
if (null == logger) {
logger = LogManager.get("metric." + name);
enabledMap.put(name, logger);
}
return logger.isTraceEnabled() ? metric() : Metric.NULL_METRIC;
}
开发者ID:actframework,项目名称:actframework,代码行数:13,代码来源:SimpleMetricPlugin.java
示例3: LogSupport
import org.osgl.logging.LogManager; //导入依赖的package包/类
/**
* Used by sub class that want to implement it's own logging logic.
*
* Typically for class that generates massive number of instances and
* want to avoid creating logger every time.
*
* @param noLogger if `false` then logger will not be generated
*/
protected LogSupport(boolean noLogger) {
logger = noLogger ? null : LogManager.get(getClass());
}
开发者ID:actframework,项目名称:actframework,代码行数:12,代码来源:LogSupport.java
注:本文中的org.osgl.logging.LogManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论