当前位置: 首页>>代码示例>>Java>>正文


Java LogLevel类代码示例

本文整理汇总了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;
  }
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:18,代码来源:AndroidLogWriter.java

示例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");
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:19,代码来源:Debug.java

示例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);
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:10,代码来源:TextLogWriter.java

示例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();}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:13,代码来源:TextLogWriter.java

示例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);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:10,代码来源:TextLogWriter.java

示例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();
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:12,代码来源:TextLogWriter.java

示例7: log

import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
@Override
public void log(LogLevel level, String message) {
	println(getString(level, message));
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:5,代码来源:TextLogWriter.java

示例8: log

import ethanjones.cubes.core.logging.LogLevel; //导入依赖的package包/类
@Override
public void log(LogLevel level, String message) {
  println(getString(level, message));
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:5,代码来源:TextLogWriter.java


注:本文中的ethanjones.cubes.core.logging.LogLevel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。