本文整理汇总了Java中com.esotericsoftware.minlog.Log.debug方法的典型用法代码示例。如果您正苦于以下问题:Java Log.debug方法的具体用法?Java Log.debug怎么用?Java Log.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esotericsoftware.minlog.Log
的用法示例。
在下文中一共展示了Log.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTask
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Add a task to this executor.
* Does not execute that task! Call exec(taskname) to start that task.
* @param task
*/
public void addTask(Task task) {
if (task.getName() == null) {
Log.error("TaskExecutor", "Task name must not be null!");
System.exit(1);
}
if (tasks.containsKey(task.getName())) {
if (Log.DEBUG) Log.debug("TaskExecutor", "Skipped duplicate task: " + task.getName());
return;
}
tasks.put(task.getName(), task);
// Add this task to the files index
for (File file : task.getTargetFiles()) {
filesCreatedByTask.put(file, task.getName());
}
}
示例2: load
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Load world info from the export files.
*/
public static void load() {
data = new HashMap<>();
// World size will be taken from the biome export map
loadWorldSize();
loadNameFromHistory();
data.put("timestamp", ExportFiles.getDate());
// Export the worldfile
File worldInfoFile = BuildFiles.getWorldFile();
try (Output output = new Output(new FileOutputStream(worldInfoFile))) {
Uristmaps.kryo.writeObject(output, data);
} catch (FileNotFoundException e) {
Log.warn("WorldInfo", "Error when writing state file: " + worldInfoFile);
if (Log.DEBUG) Log.debug("WorldInfo", "Exception", e);
}
}
示例3: compileUristJs
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Load the urist.js template and compile it with project information.
*/
public static void compileUristJs() {
Log.info("TemplateRenderer", "Writing urist.js");
VelocityContext context = new VelocityContext();
context.put("conf", Uristmaps.conf);
context.put("version",Uristmaps.VERSION);
Template uristJs = Velocity.getTemplate("templates/js/urist.js.vm");
File targetFile = OutputFiles.getUristJs();
targetFile.getParentFile().mkdirs();
try (FileWriter writer = new FileWriter(targetFile)) {
uristJs.merge(context, writer);
} catch (IOException e) {
Log.warn("TemplateRenderer", "Could not write js file: " + targetFile);
if (Log.DEBUG) Log.debug("TemplateRenderer", "Exception", e);
}
}
示例4: initSites
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Load the sites data from the prepared kryo file.
*/
private static void initSites() {
File sitesFile = BuildFiles.getSitesFile();
try (Input input = new Input(new FileInputStream(sitesFile))) {
sites = Uristmaps.kryo.readObject(input, HashMap.class);
return;
} catch (Exception e) {
Log.warn("Sites", "Error when reading state file: " + sitesFile);
if (sitesFile.exists()) {
// This might have happened because an update changed the class and it can no longer be read
// remove the file and re-generate it in the next run.
sitesFile.delete();
Log.info("Sites", "The file has been removed. Please try again.");
}
if (Log.DEBUG) Log.debug("Sites", "Exception", e);
System.exit(1);
}
}
示例5: distResources
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Copy the contents of the res/ folder into the specified output.
*/
public static void distResources() {
Log.info("FileCopier", "Copying static resources to output.");
try {
copyFilesOfDirTo(new File("res"), new File((Uristmaps.conf.fetch("Paths", "output"))));
// TODO: Don't just copy _all_files, as many are not used. Especiialy the suffixed icons.
FileUtils.copyDirectory(new File(Uristmaps.conf.fetch("Paths", "tiles"), "32"),
new File(Uristmaps.conf.fetch("Paths", "output"), "biome_legend"));
} catch (IOException e) {
Log.error("FileCopier", "Failed to copy the files: " + e.getMessage());
if (Log.DEBUG) Log.debug("FileCopier", "Exception", e);
System.exit(1);
}
}
示例6: copy
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Copies all site maps into the output directory to make them available for the web app.
*/
public static void copy() {
for (File imageFile : ExportFiles.getAllSitemaps()) {
// Resolve id of the site
Matcher matcher = idFind.matcher(imageFile.getName());
if (!matcher.find()) continue;
int id = Integer.parseInt(matcher.group(2));
// Copy the sitemap file into the output directory
try {
FileUtils.copyFile(imageFile, OutputFiles.getSiteMap(id));
} catch (IOException e) {
Log.error("SiteMaps", "Could not copy image file to: " + OutputFiles.getSiteMap(id));
if (Log.DEBUG) Log.debug("SiteMaps", "Exception", e);
System.exit(1);
}
}
}
示例7: handle
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
void handle(ConnectionInfo connection, PointInfo object) {
PlayerInfo playerInfo = new PlayerInfo();
playerInfo.name = connection.name;
playerInfo.pointInfo = object;
players.put(playerInfo.name, playerInfo.pointInfo);
server.sendToAllExceptTCP(connection.getID(), playerInfo);
Log.debug("Sent player info \"" + connection.name + "\" (" + object.x + ", " + object.y + ") to all except " + connection.name);
}
示例8: getDirty
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Filter all "dirty" files from the provided files.
* @param files Files that are to be checked.
* @return All files that are either missing or have no/wrong data stored.
*/
public File[] getDirty(File[] files) {
List<File> result = new LinkedList<>();
for (File f : files) {
if (!fileOk(f)) result.add(f);
}
Log.debug("FileWatcher", "From " + files.length + " provided files, " + result.size() + " were dirty.");
return result.toArray(new File[]{});
}
示例9: updateFiles
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Add the current state of the provided files to the store.
* @param files
*/
public void updateFiles(File[] files) {
for (File f : files) {
fileMap.put(f.getAbsolutePath(), new FileInfo(f));
}
Log.debug("FileWatcher", "Updated " + files.length + " files.");
saveFile();
}
示例10: writePopulationsJS
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void writePopulationsJS() {
Log.info("Heatmaps", "Writing population info");
// Write the js data
StringBuilder fileContent = new StringBuilder("var populations = {");
for (String raceName : WorldSites.getPopulationDistribution().navigableKeySet()) {
fileContent.append("\"").append(raceName).append("\":{");
fileContent.append("max:").append(WorldSites.getPopulationCounts().get(raceName)).append(",data:[");
for (Site site : WorldSites.getPopulationDistribution().get(raceName)) {
fileContent.append("{lat:").append(site.getLat());
fileContent.append(",lng:").append(site.getLon());
fileContent.append(",count:").append(site.getPopulations().get(raceName));
fileContent.append("},");
}
fileContent.deleteCharAt(fileContent.length() - 1); // Remove last ,
fileContent.append("]},\n");
}
fileContent.append("};");
try (FileWriter writer = new FileWriter(OutputFiles.getPopulationJs())) {
writer.write(fileContent.toString());
} catch (IOException e) {
Log.error("Heatmaps", "Could not write population file: " + OutputFiles.getPopulationJs());
if (Log.DEBUG) Log.debug("Heatmaps", "Exception", e);
System.exit(1);
}
}
示例11: saveFile
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public void saveFile() {
File storeFile = BuildFiles.getFileStore();
try (Output output = new Output(new FileOutputStream(storeFile))) {
Uristmaps.kryo.writeObject(output, fileMap);
} catch (FileNotFoundException e) {
Log.warn("FileWatcher", "Error when writing state file: " + storeFile);
if (Log.DEBUG) Log.debug("FileWatcher", "Exception", e);
}
Log.debug("FileWatcher", "Saved store.");
}
示例12: load
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Update the site coordinates by centering them on the respective structure-group that is closest to them.
*/
public static void load(Collection<Site> sites) {
Set<Integer> visitedGroups = new HashSet<>();
int groupSize = StructureGroups.getGroupIds().size();
int [][] grps = StructureGroups.getGroupMap();
siteCenters = new HashMap<>();
// Iterate over all sites, find the closest group and move the site there.
for (Site site : sites) {
if (!typeToStruct.containsKey(site.getType())) continue;
StructureGroup group = findClosestGroup(site, grps, visitedGroups);
if (group == null) {
Log.warn("SiteCenters", "Could not find close group for site " + site + "@" + site.getCoords());
continue;
}
// Move the site to that group.
visitedGroups.add(group.getId());
siteCenters.put(site.getId(), group.getCenter());
// Stop when no more groups are available.
if (visitedGroups.size() == groupSize) break;
}
// Save the sites with the new coordinates
try (Output output = new Output(new FileOutputStream(BuildFiles.getSiteCenters()))) {
Uristmaps.kryo.writeObject(output, siteCenters);
} catch (FileNotFoundException e) {
Log.error("SiteCenters", "Could not write site centers file.");
if (Log.DEBUG) Log.debug("SiteCenters", "Exception", e);
}
}
示例13: loadNameFromHistory
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Load the name(s) from the history file.
*/
private static void loadNameFromHistory() {
Log.debug("WorldInfo", "Reading population counts.");
try (BufferedReader reader = new BufferedReader(new FileReader(ExportFiles.getWorldHistory()))) {
data.put("name", WordUtils.capitalize(reader.readLine()));
data.put("nameEnglish", WordUtils.capitalize(reader.readLine()));
} catch (Exception e) {
Log.error("WorldInfo", "Could not read population info file.");
if (Log.DEBUG) Log.debug("WorldInfo", "Exception", e);
System.exit(1);
}
}
示例14: loadWorldSize
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Load the biome map and check its px size for world unit-size.
*/
private static void loadWorldSize() {
Log.debug("WorldInfo", "Importing world size from biome");
try {
BufferedImage image = ImageIO.read(ExportFiles.getBiomeMap());
data.put("size", image.getWidth() + "");
} catch (IOException e) {
Log.error("WorldInfo", "Could not read biome image file.");
if (Log.DEBUG) Log.debug("WorldInfo", "Exception", e);
System.exit(1);
}
}
示例15: report
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Print the current percentage.
*/
public void report() {
int percent = (int)((float) current / max * 100);
StringBuilder msg = new StringBuilder();
msg.append(percent).append("% (").append(current).append("/").append(max).append(")");
if (loglevel == Log.LEVEL_DEBUG) {
Log.debug(category, msg.toString());
} else if (loglevel == Log.LEVEL_INFO) {
Log.info(category, msg.toString());
}
}