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


Java Log.debug方法代码示例

本文整理汇总了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());
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:22,代码来源:TaskExecutor.java

示例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);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:21,代码来源:WorldInfo.java

示例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);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:21,代码来源:TemplateRenderer.java

示例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);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:21,代码来源:WorldSites.java

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

示例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);
        }
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:20,代码来源:Sitemaps.java

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

示例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[]{});
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:14,代码来源:FileWatcher.java

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

示例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);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:28,代码来源:Heatmaps.java

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

示例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);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:35,代码来源:SiteCenters.java

示例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);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:15,代码来源:WorldInfo.java

示例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);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:16,代码来源:WorldInfo.java

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


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