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


Java Log.warn方法代码示例

本文整理汇总了Java中com.esotericsoftware.minlog.Log.warn方法的典型用法代码示例。如果您正苦于以下问题:Java Log.warn方法的具体用法?Java Log.warn怎么用?Java Log.warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.esotericsoftware.minlog.Log的用法示例。


在下文中一共展示了Log.warn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCenters

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
 * DOCME
 * @return
 */
public static Map<Integer, Coord2> getCenters() {
    File centersFile = BuildFiles.getSiteCenters();
    if (siteCenters == null) {
        try (Input input = new Input(new FileInputStream(centersFile))) {
            siteCenters = Uristmaps.kryo.readObject(input, HashMap.class);
        } catch (Exception e) {
            Log.warn("SiteCenters", "Error when reading site centers file: " + centersFile);
            if (centersFile.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.
                centersFile.delete();
                Log.info("SiteCenters", "The file has been removed. Please try again.");
            }
            System.exit(1);
        }
    }
    return siteCenters;
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:23,代码来源:SiteCenters.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: loadData

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
 * Load the saved data.
 */
private static void loadData() {
    File worldFile = BuildFiles.getWorldFile();
    try (Input input = new Input(new FileInputStream(worldFile))) {
        data = Uristmaps.kryo.readObject(input, HashMap.class);
    } catch (Exception e) {
        Log.warn("WorldInfo", "Error when reading world info file: " + worldFile);
        if (worldFile.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.
            worldFile.delete();
            Log.info("WorldInfo", "The file has been removed. Please try again.");
        }
        System.exit(1);
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:19,代码来源:WorldInfo.java

示例4: 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

示例5: loadSitemaps

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
 * DOCME
 * @return
 */
private static Map<Integer, SitemapInfo> loadSitemaps() {
    File sitemapsFile = BuildFiles.getSitemapsIndex();
    try (Input input = new Input(new FileInputStream(sitemapsFile))) {
        return Uristmaps.kryo.readObject(input, HashMap.class);
    } catch (Exception e) {
        Log.warn("WorldSites", "Error when reading sitemaps index file: " + sitemapsFile);
        if (sitemapsFile.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.
            sitemapsFile.delete();
            Log.info("WorldSites", "The file has been removed. Please try again.");
        }
        System.exit(1);
    }
    return null;
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:21,代码来源:WorldSites.java

示例6: 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

示例7: getTilesetIndex

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
 * Load the index data for the tileset of the given level.
 * @param level
 * @return
 */
public static Map<String, Coord2> getTilesetIndex(int level) {
    File tilesetIndex = BuildFiles.getTilesetIndex(level);
    try (Input input = new Input(new FileInputStream(tilesetIndex))) {
        return Uristmaps.kryo.readObject(input, HashMap.class);
    } catch (Exception e) {
        Log.warn("Tilesets", "Error when reading tileset index file: " + tilesetIndex);
        if (tilesetIndex.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.
            tilesetIndex.delete();
            Log.info("Tilesets", "The file has been removed. Please try again.");
        }
        System.exit(1);
    }
    return null;
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:22,代码来源:Tilesets.java

示例8: getColorTable

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
 * Load the color table data from kryo file.
 * @param size
 * @return
 */
public static Map<String, Color> getColorTable(int size) {
    File tilesFile = BuildFiles.getTilesetColorFile(size);
    Map<String, Integer> colors = null;
    Map<String, Color> result = new HashMap<>();
    try (Input input = new Input(new FileInputStream(tilesFile))) {
        colors = Uristmaps.kryo.readObject(input, HashMap.class);
    } catch (Exception e) {
        Log.warn("Tilesets", "Error when reading tileset file: " + tilesFile);
        if (tilesFile.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.
            tilesFile.delete();
            Log.info("Tilesets", "The file has been removed. Please try again.");
        }
        System.exit(1);
    }

    for (Map.Entry<String, Integer> entry : colors.entrySet()) {
        result.put(entry.getKey(), new Color(entry.getValue()));
    }
    return result;
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:28,代码来源:Tilesets.java

示例9: getBiomeData

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
 * Call this to retrieve the biome data.
 * This info is cached after the first call.
 * @return
 */
public static String[][] getBiomeData() {
    if (biomeData != null) {
        return biomeData;
    }
    // TODO: Reading from the image might be faster than this kryo import.
    File biomeInfoFile = BuildFiles.getBiomeInfo();
    try (Input input = new Input(new FileInputStream(biomeInfoFile))) {
        biomeData = Uristmaps.kryo.readObject(input, String[][].class);
        return biomeData;
    } catch (Exception e) {
        Log.warn("BiomeInfo", "Error when reading biome file: " + biomeInfoFile);
        if (biomeInfoFile.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.
            biomeInfoFile.delete();
            Log.info("BiomeInfo", "The file has been removed. Please try again.");
        }
        System.exit(1);
    }
    return null;
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:27,代码来源:BiomeInfo.java

示例10: FileWatcher

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
 * Create a new filewatcher. Will automatically try to read the stored info.
 */
public FileWatcher() {
    // Try to read the file-info file.
    File storeFile = BuildFiles.getFileStore();
    if (storeFile.exists()) {
        try (Input input = new Input(new FileInputStream(storeFile))) {
            fileMap = Uristmaps.kryo.readObject(input, HashMap.class);
        } catch (Exception e) {
            Log.warn("FileWatcher", "Error when reading file cache: " + storeFile);
            if (storeFile.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.
                storeFile.delete();
                Log.info("FileWatcher", "The file has been removed. Please try again.");
            }
            System.exit(1);
        }
    } else {
        fileMap = new HashMap<>();
    }
}
 
开发者ID:dominiks,项目名称:uristmapsj,代码行数:24,代码来源:FileWatcher.java

示例11: chatMessagePacketReceived

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public void chatMessagePacketReceived(ChatMessageReplyPacket packet)
{
	userInterface.addMessageToDialogChat(packet);
	GameObject source = gameObjects.get(packet.sourceCharacterId);
	GameWorldLabel message = new GameWorldLabel(packet.getMessage(), source);
	if (!clientGraphics.offer(message))
		Log.warn("Couldn't add graphic object ");
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:9,代码来源:PlayState.java

示例12: getCollisionContainerId

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Override
public int getCollisionContainerId()
{
    if (collisionContainerId == -1)
        Log.warn("Container id was not set, but it is used. "
                + "If this message shows more than once per container, "
                + "there is a bug in your code");
    return collisionContainerId;
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:10,代码来源:MonsterBody.java

示例13: build

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public ItemLootInfo build()
{
	if(itemLootInfo.itemIdentifier == null)
		Log.error("Item identifier was not set!");
	if(itemLootInfo.chancesOfDropping == 0)
		Log.warn("Chances of dropping item was not set, default 0");
	if(itemLootInfo.itemNumberRange == null)
		Log.error("ItemNumberRange was not set!");
			
	return itemLootInfo;
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:12,代码来源:ItemLootInfo.java

示例14: assertAllSeedersAreUsed

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
private void assertAllSeedersAreUsed(Collection<TableSeeder> seeders)
{
	Reflections reflections = new Reflections(TableSeeder.class.getPackage().getName());
	Set<Class<? extends TableSeeder>> subTypes = reflections.getSubTypesOf(TableSeeder.class);
	if(subTypes.size() != seeders.size())
		Log.warn("Used seeders: " + seeders.size() + ", but there are total " + subTypes.size());
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:8,代码来源:DatabaseSeedCommand.java

示例15: handle

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
void handle(ConnectionInfo connection, MessageInfo object) {
  if (object.name != null) {
    Log.info("MessageInfo is auto-populated, setting to non-null is useless");
  }

  if (connection.name == null) {
    Log.warn("Expected connection.name to be non-null");
    return;
  }

  String message = object.text;
  if (message == null) {
    Log.warn("Expected message to be non-null");
    return;
  }

  message = message.trim();
  if (message.length() == 0) {
    Log.warn("Expected message.length to be greater than 0");
    return;
  }

  object.name = connection.name;
  object.text = message;
  server.sendToAllExceptTCP(connection.getID(), object);

  Log.info("Sent chat \"" + message.substring(0, Math.min(10, message.length())) + "\" to all except " + connection.name);
}
 
开发者ID:Pheelbert,项目名称:chatterino,代码行数:29,代码来源:NetworkServer.java


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