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


Java Log.info方法代码示例

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


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

示例1: startCommandHandlerOnNewThread

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
private void startCommandHandlerOnNewThread()
{
    Log.info("NOTE: you can now type commands here.");
    CommandHandler commandHandler = new CommandHandler();
    Runnable commandHandlingTask = () ->
    {
        try (Scanner scanner = new Scanner(System.in))
        {
            while (true)
            {
                String command = scanner.nextLine();
                commandHandler.handle(command);
            }
        }
    };
    new Thread(commandHandlingTask).start();
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:18,代码来源:GameServer.java

示例2: AttributesFile

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public AttributesFile(byte[] file) {
    this.file = file;
    ByteBuffer buffer = ByteBuffer.wrap(file);
    buffer.order(ByteOrder.LITTLE_ENDIAN);
    buffer.position(8);
    int fileCount = (file.length - 8) / 12 - 1;
    crc32 = new int[fileCount];
    timestamps = new long[fileCount];
    for (int i = 0; i < fileCount; i++) {
        crc32[i] = buffer.getInt();
    }
    for (int i = 0; i < fileCount; i++) {
        timestamps[i] = buffer.getLong();
    }
    Log.info("parsed attributes");
}
 
开发者ID:inwc3,项目名称:JMPQ3,代码行数:17,代码来源:AttributesFile.java

示例3: testExtractScriptFile

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Test
public void testExtractScriptFile() throws IOException {
    File[] mpqs = getMpqs();
    for (File mpq : mpqs) {
        Log.info("test extract script: " + mpq.getName());
        JMpqEditor mpqEditor = new JMpqEditor(mpq, MPQOpenOption.READ_ONLY, MPQOpenOption.FORCE_V0);
        File temp = File.createTempFile("war3mapj", "extracted", JMpqEditor.tempDir);
        temp.deleteOnExit();
        if (mpqEditor.hasFile("war3map.j")) {
            String extractedFile = mpqEditor.extractFileAsString("war3map.j").replaceAll("\\r\\n", "\n").replaceAll("\\r", "\n");
            String existingFile = new String(Files.readAllBytes(getFile("war3map.j").toPath())).replaceAll("\\r\\n", "\n").replaceAll("\\r", "\n");
            Assert.assertEquals(existingFile, extractedFile);
        }
        mpqEditor.close();
    }
}
 
开发者ID:inwc3,项目名称:JMPQ3,代码行数:17,代码来源:MpqTests.java

示例4: init

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public void init() throws Exception {
    Gson gson = new Gson();
    try (FileReader f = new FileReader("worlds.json");
        BufferedReader br = new BufferedReader(f);) {
        WorldBean[] worldBeans = gson.fromJson(br, WorldBean[].class);
        for (WorldBean bean : worldBeans) {
            MapInstance instance = new MapInstance(bean.id, bean.name, bean.serverFile, bean.clientFile);
            try {
                Log.info("Initialisating map '" + bean.name + "'(" + bean.id + "'...");
                instance.init();
                mMapInstances.put(bean.id, instance);
            } catch (Exception e) {
                Log.info("Error on initialisation of the map '" + bean.name +"'(" + bean.id +"). Do not add it to the map instances list.", e);
            }
        }
    }
    if (mMapInstances.get(0) == null) {
        throw new Exception("No default map instance found.");
    }
}
 
开发者ID:AlexMog,项目名称:MMO-Rulemasters-World,代码行数:21,代码来源:MapInstancesManager.java

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

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

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

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Override
public void received(Connection connection, Object packet)
{
	PacketHandler packetHandler = packetHandlersFactory.produce(packet);
	if (packetHandler.canBeHandled(packet))
		packetHandler.handle(packet);
	else if(!packetHandler.canBeOmmited(packet))
		unhandledPackets.add(new PacketInfo(connection.getID(), packet));
	
	if(!(packet instanceof ObjectRepositionPacket))
		Log.info("Packet received from server, id: " + connection.getID() + "packet: " + packet);
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:13,代码来源:ClientListener.java

示例9: disconnected

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Override
public void disconnected(Connection connection)
{
    if (authenticatedClientsKeyClientId.containsKey(connection.getID()))
    {
        LogoutPacket logoutPacket = new LogoutPacket();
        PacketHandler packetHandler = packetHandlersFactory.produce(logoutPacket);
        packetHandler.handle(logoutPacket, connection);
    }

    Log.info("User disconnected, id: " + connection.getID());
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:13,代码来源:ServerListener.java

示例10: received

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Override
public void received(Connection connection, Object object)
{
    PacketHandler packetHandler = packetHandlersFactory.produce(object);
    packetHandler.handle(object, connection);
    Log.info("Packet received, client id: " + connection.getID() + ", packet: " + object);
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:8,代码来源:ServerListener.java

示例11: handle

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Override
public void handle(Connection connection, OpenContainterPacket packet)
{
	if(playState.hasContainer(packet.gameX, packet.gameY))
	{
		GameContainer container = playState.getContainer(packet.gameX, packet.gameY);
		connection.sendTCP(PacketsMaker.makeOpenContainerPacket(container));
	}
	Log.info("OpenContainer packet received" + packet.gameX + " " + packet.gameY);
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:11,代码来源:OpenContainerPacketHandler.java

示例12: testToLongError

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Test
public void testToLongError() {
    String dpidStr = "09:08:07:06:05:04:03:02:01";
    try {
        HexString.toLong(dpidStr);
        fail("HexString.toLong() should have thrown a NumberFormatException");
    } catch (NumberFormatException expected) {
        Log.info("HexString.toLong() have thrown a NumberFormatException");
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:HexStringTest.java

示例13: testFromHexStringError

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Test
public void testFromHexStringError() {
    String invalidStr = "00:00:00:00:00:00:ffff";
    try {
        HexString.fromHexString(invalidStr);
        fail("HexString.fromHexString() should have thrown a NumberFormatException");
    } catch (NumberFormatException expected) {
        Log.info("HexString.toLong() have thrown a NumberFormatException");
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:HexStringTest.java

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

示例15: runWithConfig

import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void runWithConfig(ServerConfiguration config) throws Exception {
  URI baseUri = UriBuilder.fromUri("http://0.0.0.0/").port(config.port).build();
  // ResourceConfig rConfig = new
  // ResourceConfig(QueryResource.class).register;

  MultiCube cube = new MultiCubeImpl(new File(config.path).getAbsolutePath());
  cube.load(cube.getPath());
  CubeApplication rConfig = new CubeApplication(config, cube);
  registerStuff(rConfig);
  HttpServer server = GrizzlyHttpServerFactory.createHttpServer(baseUri, rConfig);
  Log.info("Starting server");
  server.start();
  Thread.currentThread().join();
  Log.info("Shutting down");
}
 
开发者ID:cubedb,项目名称:cubedb,代码行数:16,代码来源:CubeApplication.java


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