當前位置: 首頁>>代碼示例>>Java>>正文


Java Log.error方法代碼示例

本文整理匯總了Java中com.esotericsoftware.minlog.Log.error方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.error方法的具體用法?Java Log.error怎麽用?Java Log.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.esotericsoftware.minlog.Log的用法示例。


在下文中一共展示了Log.error方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sendAckInfoToCtrlTopic

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
private static void sendAckInfoToCtrlTopic(String dataSourceInfo, String completedTime, String pullStatus) {
    try {
        // 在源dataSourceInfo的基礎上,更新全量拉取相關信息。然後發回src topic
        JSONObject jsonObj = JSONObject.parseObject(dataSourceInfo);
        jsonObj.put(DataPullConstants.FullPullInterfaceJson.FROM_KEY, DataPullConstants.FullPullInterfaceJson.FROM_VALUE);
        jsonObj.put(DataPullConstants.FullPullInterfaceJson.TYPE_KEY, DataPullConstants.FullPullInterfaceJson.TYPE_VALUE);
        // notifyFullPullRequestor
        JSONObject payloadObj = jsonObj.getJSONObject(DataPullConstants.FullPullInterfaceJson.PAYLOAD_KEY);
        // 完成時間
        payloadObj.put(DataPullConstants.FullPullInterfaceJson.COMPLETE_TIME_KEY, completedTime);
        // 拉取是否成功標誌位
        payloadObj.put(DataPullConstants.FullPullInterfaceJson.DATA_STATUS_KEY, pullStatus);
        jsonObj.put(DataPullConstants.FullPullInterfaceJson.PAYLOAD_KEY, payloadObj);
        String ctrlTopic = getFullPullProperties(Constants.ZkTopoConfForFullPull.COMMON_CONFIG, true)
            .getProperty(Constants.ZkTopoConfForFullPull.FULL_PULL_SRC_TOPIC);
        Producer producer = DbusHelper
                .getProducer(getFullPullProperties(Constants.ZkTopoConfForFullPull.BYTE_PRODUCER_CONFIG, true));
        ProducerRecord record = new ProducerRecord<>(ctrlTopic, DataPullConstants.FullPullInterfaceJson.TYPE_VALUE, jsonObj.toString().getBytes());
        Future<RecordMetadata> future = producer.send(record);
        RecordMetadata meta = future.get();
    }
    catch (Exception e) {
        Log.error("Error occurred when report full data pulling status.", e);
        throw new RuntimeException(e);
    }
}
 
開發者ID:BriData,項目名稱:DBus,代碼行數:27,代碼來源:FullPullHelper.java

示例2: processSingle

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
private void processSingle(OntModel m) {
  for (Iterator<?> i = m.listClasses(); i.hasNext(); ) {
    OntClass c = (OntClass) i.next();
    try {
      // too confusing to list all the restrictions as root classes 
      if (c.isAnon()) {
        continue;
      }

      if (c.hasSuperClass(m.getProfile().THING(), true) || c.getCardinality(m.getProfile().SUB_CLASS_OF()) == 0) {
        // this class is directly descended from Thing
        roots.add(c);
      }
    } catch (Exception e) {
      Log.error("Error during extraction or root Classes from Ontology Model: ", e);
    }
  }
}
 
開發者ID:apache,項目名稱:incubator-sdap-mudrod,代碼行數:19,代碼來源:OwlParser.java

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

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

示例5: onPacketReceived

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
public boolean onPacketReceived(Connection connection, Object packet) {
    Iterator<Class> it = mPackets.keySet().iterator();
    
    while (it.hasNext()) {
        Class item = it.next();
        try {
            if (packet.getClass().isAssignableFrom(item)) {
                PacketAction a = mPackets.get(item);
                AccountConnection c = (AccountConnection)connection;
                if (!a.needLoggedIn() || (c.getToken() != null && c.getToken().length() > 0)) {
                    a.run(c, packet);
                } else {
                    ErrorPacket p = new ErrorPacket();
                    p.message = "You are not authenticated.";
                    p.status = ErrorType.NOT_AUTHENTICATED;
                    c.sendTCP(p);
                    c.close();
                }
                return true;
            }
        } catch (Exception e) {
            Log.error("PacketInterpretator", e);
        }
    }
    return false;
}
 
開發者ID:AlexMog,項目名稱:MMO-Rulemasters-World,代碼行數:27,代碼來源:PacketsInterpretator.java

示例6: createProgressZkNode

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
public static void createProgressZkNode(ZkService zkService, DBConfiguration dbConf) {
    String dbName = (String)(dbConf.getConfProperties().get(DBConfiguration.DataSourceInfo.DB_NAME));
    String dbSchema = (String)(dbConf.getConfProperties().get(DBConfiguration.DataSourceInfo.DB_SCHEMA));
    String tableName = (String)(dbConf.getConfProperties().get(DBConfiguration.DataSourceInfo.TABLE_NAME));
    String zkPath;
    try {
        zkPath = zkMonitorRootNodePath;
        if(!zkService.isExists(zkPath)){
            zkService.createNode(zkPath, null);
        }
        zkPath = buildZkPath(zkMonitorRootNodePath, dbName);
        if(!zkService.isExists(zkPath)){
            zkService.createNode(zkPath, null);
        }
        zkPath = buildZkPath(zkMonitorRootNodePath, dbName + "/" + dbSchema);
        if(!zkService.isExists(zkPath)){
            zkService.createNode(zkPath, null);
        }
        zkPath = buildZkPath(zkMonitorRootNodePath, dbName+ "/" + dbSchema + "/" + tableName);
        if(!zkService.isExists(zkPath)){
            zkService.createNode(zkPath, null);
        }
    } catch (Exception e) {
        Log.error("create parent node failed exception!", e);
        throw new RuntimeException(e);
    }
}
 
開發者ID:BriData,項目名稱:DBus,代碼行數:28,代碼來源:FullPullHelper.java

示例7: getPixmapColor

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
private static int getPixmapColor (Pixmap pixmap){
    int color = 0;
    try {
        Field colorField = ClassReflection.getDeclaredField(Pixmap.class, "color");
        colorField.setAccessible(true);
        color = (Integer)colorField.get(pixmap);
    } catch (ReflectionException e) {
        Log.error("Color field of pixmap could not be read. Using transparent black.", e);
    }
    return color;
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:12,代碼來源:PixmapSerializer.java

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

示例9: main

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
public static void main(String[] args) {  
  try {
    new NetworkServer();
  } catch (IOException e) {
    Log.error(e.getMessage());
  }
}
 
開發者ID:Pheelbert,項目名稱:chatterino,代碼行數:8,代碼來源:Main.java

示例10: getTilesetImage

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
/**
 * Load the image data for the tileset of the given level.
 * @param level
 * @return
 */
public static BufferedImage getTilesetImage(int level) {
    try {
        return ImageIO.read(BuildFiles.getTilesetImage(level));
    } catch (IOException e) {
        Log.error("Tilesets", "Could not read tileset image file: " + BuildFiles.getTilesetImage(level));
        if (Log.DEBUG) Log.debug("Tilesets", "Exception", e);
        System.exit(1);
    }
    return null;
}
 
開發者ID:dominiks,項目名稱:uristmapsj,代碼行數:16,代碼來源:Tilesets.java

示例11: printMatrixInListOfListsFormat

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
/**
 * Writes the matrix in a List of lists (LIL) format
 */
public static void printMatrixInListOfListsFormat(org.apache.spark.mllib.linalg.Matrix m, String outputPath) {
	try
	{
		FileWriter fileWriter = new FileWriter(outputPath);
		PrintWriter printWriter= new PrintWriter(fileWriter);
		boolean firstValue=true;
		double val;
		for(int i=0; i < m.numRows(); i++)
		{
			printWriter.print("{");
			for(int j=0; j < m.numCols(); j++)
			{
				val=m.apply(i, j);
				if(val!=0)
					if(firstValue)
					{
						printWriter.print(j + ":" + val);
					    firstValue=false;
					}
					else
						printWriter.print("," + j + ":" + val);
			}
			printWriter.print("}");
			printWriter.println();
			firstValue=true;
		}
		printWriter.close();
		fileWriter.close();
	}
	catch (Exception e) {
		Log.error("Output file " + outputPath + " not found ");
	}
}
 
開發者ID:SiddharthMalhotra,項目名稱:sPCA,代碼行數:37,代碼來源:PCAUtils.java

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

示例13: updateServer

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
public void updateServer() {
    try {
        UpdateServerSnd st = new UpdateServerSnd(this.id);
        ClientResponse response = this.getClientResponse(st, "update_last_active");
        UpdateServerRcv output = response.getEntity(UpdateServerRcv.class);
        if (!output.getRes()) {
            Log.error("Master server error: " + output.getErr());
        } else {
            Log.info("Sent alive signal to data server.");
        }
    } catch (Exception e) {
        Log.error("Master: " + e.getMessage());
        e.printStackTrace();
    }
}
 
開發者ID:LeNiglo,項目名稱:TinyTank,代碼行數:16,代碼來源:DataServer.java

示例14: stopServer

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
public void stopServer() {
    try {
        updateThread.shutdown();
        StopServerSnd st = new StopServerSnd(this.id);
        ClientResponse response = this.getClientResponse(st, "stop_server");
        StopServerRcv output = response.getEntity(StopServerRcv.class);
        if (!output.getRes()) {
            Log.error("Master server error: " + output.getErr());
        }
    } catch (Exception e) {
        Log.error("Master: " + e.getMessage());
        e.printStackTrace();
    }
}
 
開發者ID:LeNiglo,項目名稱:TinyTank,代碼行數:15,代碼來源:DataServer.java

示例15: addUser

import com.esotericsoftware.minlog.Log; //導入方法依賴的package包/類
public void addUser(String pseudo) {
    try {
        AddUserSnd st = new AddUserSnd(this.id, pseudo);
        ClientResponse response = this.getClientResponse(st, "add_user");
        AddUserRcv output = response.getEntity(AddUserRcv.class);
        if (!output.getRes()) {
            Log.error("Master server error: " + output.getErr());
        }
    } catch (Exception e) {
        Log.error("Master: " + e.getMessage());
        e.printStackTrace();
    }
}
 
開發者ID:LeNiglo,項目名稱:TinyTank,代碼行數:14,代碼來源:DataServer.java


注:本文中的com.esotericsoftware.minlog.Log.error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。