本文整理汇总了Java中ethanjones.cubes.core.logging.LogLevel类的典型用法代码示例。如果您正苦于以下问题:Java LogLevel类的具体用法?Java LogLevel怎么用?Java LogLevel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LogLevel类属于ethanjones.cubes.core.logging包,在下文中一共展示了LogLevel类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
@Override
public void log(LogLevel level, String message) {
switch (level) {
case error:
Log.e(Thread.currentThread().getName(), message);
break;
case warning:
Log.w(Thread.currentThread().getName(), message);
break;
case info:
Log.i(Thread.currentThread().getName(), message);
break;
case debug:
Log.d(Thread.currentThread().getName(), message);
break;
}
}
示例2: printMods
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
private static synchronized void printMods(LogLevel logLevel) {
if (ModManager.getMods().size() > 0) {
Log.log(logLevel, "Mods:");
for (ModInstance modInstance : ModManager.getMods()) {
StringBuilder builder = new StringBuilder();
builder.append(modInstance.getName());
List<ModState> modStates = modInstance.getModStates();
if (modStates.size() > 0) builder.append(" - ");
for (int i = 0; i < modStates.size(); i++) {
builder.append(modStates.get(i).name());
if (i != modStates.size() - 1) builder.append(" > ");
}
Log.log(logLevel, builder.toString());
}
} else {
Log.log(logLevel, "No Mods");
}
}
示例3: printThrowable
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
private void printThrowable(LogLevel level, Throwable throwable) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
throwable.printStackTrace(pw);
String start = getString(level, "");
for (String s : sw.toString().split("\n")) {
println(start + s);
}
}
示例4: getString
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
private String getString(LogLevel level, String message) {
synchronized(dateFormat){
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(dateFormat.format(new Date()));
stringBuilder.append(" [");
stringBuilder.append(level.name().toUpperCase());
stringBuilder.append("] [");
stringBuilder.append(Thread.currentThread().getName());
stringBuilder.append("] ");
stringBuilder.append(message);
return stringBuilder.toString();}
}
示例5: printThrowable
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
private void printThrowable(LogLevel level, Throwable throwable) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
throwable.printStackTrace(pw);
String start = getString(level, "");
for (String s : sw.toString().split("\n")) {
println(start + s);
}
}
示例6: getString
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
private synchronized String getString(LogLevel level, String message) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(dateFormat.format(new Date()));
stringBuilder.append(" [");
stringBuilder.append(level.name().toUpperCase());
stringBuilder.append("] [");
stringBuilder.append(Thread.currentThread().getName());
stringBuilder.append("] ");
stringBuilder.append(message);
return stringBuilder.toString();
}
示例7: log
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
@Override
public void log(LogLevel level, String message) {
println(getString(level, message));
}
示例8: log
import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
@Override
public void log(LogLevel level, String message) {
println(getString(level, message));
}