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


Java Log.info方法代码示例

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


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

示例1: update

import jline.internal.Log; //导入方法依赖的package包/类
public void update(String subreddit, String storyId, String storyURL, String storyTitle, String commentId,
		String comment, int sentimentScore, long timestamp) {
	
	StoryData story = stories.get(storyId);
	if (story == null) {
		story = new StoryData();
		story.subreddit = subreddit;
		story.storyId = storyId;
		story.storyURL = storyURL;
		story.storyTitle = storyTitle;
		stories.put(storyId, story);
	}
	
	story.update(commentId, comment, sentimentScore, timestamp);
	
	// Discard stories that have not received any comment during the time window.
	long curTimestamp = System.currentTimeMillis();
	for (Iterator<StoryData> itr = stories.values().iterator(); itr.hasNext();) {
		StoryData s = itr.next();
		if (curTimestamp - s.lastCommentTimestamp > TIME_WINDOW) {
			Log.info("No comment received for {}:{}. Discarding", s.storyId, s.storyURL);
			itr.remove();
		}
	}
}
 
开发者ID:pathbreak,项目名称:reddit-sentiment-storm,代码行数:26,代码来源:Summary.java

示例2: run

import jline.internal.Log; //导入方法依赖的package包/类
@Override
    public void run(IFloraOn driver) throws FloraOnException, IOException {
        Log.info("Updating red list dataset for " + territory);
        Iterator<RedListDataEntity> rldel = driver.getRedListData().getAllRedListData(territory, false, null);
        Map<String, Object> v = new HashMap<>();

        while(rldel.hasNext()) {
        RedListDataEntity rlde = rldel.next();
            InferredStatus is = driver.wrapTaxEnt(driver.asNodeKey(rlde.getTaxEntID())).getInferredNativeStatus(territory);
//            rlde.setInferredStatus(is);
//            INodeKey nk = driver.asNodeKey(rlde.getID());
//            driver.getRedListData().updateRedListDataEntity(territory, nk, rlde, false);
            v.clear();
            v.put("inferredStatus", is);
            driver.getRedListData().updateRedListDataEntities(territory, new String[] {rlde.getTaxEntID()}, v);
            n++;
        }

    }
 
开发者ID:miguel-porto,项目名称:flora-on-server,代码行数:20,代码来源:UpdateNativeStatusJob.java

示例3: matchTaxEntNames

import jline.internal.Log; //导入方法依赖的package包/类
@Override
    public void matchTaxEntNames(Inventory inventory, boolean createNew, boolean doMatch, InventoryList inventories) throws FloraOnException {
        INodeWorker nwd = driver.getNodeWorkerDriver();
        MutableBoolean ask = new MutableBoolean(false);
        for(OBSERVED_IN oi : inventory.getUnmatchedOccurrences()) {
            TaxEnt te, te1;
            List<TaxEnt> matched;
            Log.info("Verbose name: "+ oi.getVerbTaxon());
            if(oi.getVerbTaxon() == null) continue;

            if(oi.getVerbTaxon().trim().equals("")) {
                Log.info("    Empty name, clearing");
//                if(inventories != null) inventories.addNoMatch(oi);
                oi.setTaxEntMatch("");
                continue;
            }

            try {
                te = TaxEnt.parse(oi.getVerbTaxon());
            } catch (FloraOnException e) {  // could not even parse the name
                if(inventories != null)
//                    inventories.addQuestion(oi.getVerbTaxon(), oi.getUuid(), null);
                    inventories.addParseError(oi.getVerbTaxon());
                Log.warn(e.getMessage());
                oi.setTaxEntMatch("");
                continue;
            }
            Log.info("    Parsed name: "+ te.getFullName(false));
            matched = nwd.getTaxEnt(te, ask);

            switch(matched.size()) {
            case 0:
                if (createNew) {
                    te1 = nwd.createTaxEntFromTaxEnt(te);
                    Log.warn("    No match, created new taxon");
                    if(inventories != null) inventories.addNoMatch(oi);
                    oi.setTaxEntMatch(te1.getID());
                } else {
                    Log.warn("    No match, do you want to add new taxon?");
                    if(inventories != null)
                        inventories.addQuestion(oi.getVerbTaxon(), oi.getUuid(), null);
                        //inventories.addNoMatch(oi);
                    oi.setTaxEntMatch("");
                }
                break;

            default:
                if(!ask.booleanValue()) {
                    Log.info("    Matched name: " + matched.get(0).getFullName(false), " -- ", matched.get(0).getID());
                    oi.setTaxEntMatch(matched.get(0).getID());
                    if(doMatch && inventories != null) {
                        Map<String, TaxonomicChange> tmp1 = new HashMap<>();
                        tmp1.put(oi.getVerbTaxon(), new TaxonomicChange(matched.get(0).getID(), oi.getUuid().toString(), null));
                        replaceTaxEntMatch(tmp1);
                        inventories.getVerboseWarnings().add("Automatically matched " + oi.getVerbTaxon() + " to " + matched.get(0).getID());
                        //inventories.addQuestion(oi.getVerbTaxon(), oi.getUuid(), matched.get(0));
                    }
                } else {
                    if(matched.size() == 0 && inventories != null)
                        inventories.addQuestion(oi.getVerbTaxon(), oi.getUuid(), null);
                    else {
                        for (TaxEnt tmp : matched) {
                            if (inventories != null)
                                inventories.addQuestion(oi.getVerbTaxon(), oi.getUuid(), tmp);
                        }
                    }
                    oi.setTaxEntMatch("");
                }
                break;
            }
        }
    }
 
开发者ID:miguel-porto,项目名称:flora-on-server,代码行数:73,代码来源:GOccurrenceDriver.java

示例4: start

import jline.internal.Log; //导入方法依赖的package包/类
/**
 * Start the ssh daemon.
 */
public void start() {
    final String portString = System.getProperty(COMMANDER_SSH_PORT);
    if (portString == null) {
        Log.warn("No 'commander.ssh.port' specified, ssh support will not be enabled!");
        return;
    }

    int port;
    try {
        port = Integer.parseInt(portString);
    } catch (NumberFormatException ex) {
        Log.error("Bad port '" + portString + "' specified, ssh support will not be enabled!");
        return;
    }

    final String username = System.getProperty(COMMANDER_SSH_USERNAME);
    if (username == null) {
        Log.warn("No 'commander.ssh.username' specified, ssh support will not be enabled!");
        return;
    }

    final String password = System.getProperty(COMMANDER_SSH_PASSWORD);
    if (password == null) {
        Log.warn("No 'commander.ssh.password' specified, ssh support will not be enabled!");
        return;
    }

    this.sshd = SshServer.setUpDefaultServer();
    sshd.setPasswordAuthenticator(new PasswordAuthenticator() {
        @Override
        public boolean authenticate(@Nullable String u, @Nullable String p, ServerSession serverSession) {
            if (p == null || u == null) {
                return false;
            }
            return MessageDigest.isEqual(username.getBytes(StandardCharsets.UTF_8), u.getBytes(StandardCharsets.UTF_8))
                    && MessageDigest.isEqual(password.getBytes(StandardCharsets.UTF_8), p.getBytes(StandardCharsets.UTF_8));
        }
    });
    sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("hostkey.ser"));


    sshd.setPort(port);

    sshd.setShellFactory(new CommanderSshCommandFactory());

    try {
        sshd.start();
        Log.info("Ssh support started on port " + port);
    } catch (IOException e) {
        Log.error("Couldn't start the ssh daemon", e);
    }
}
 
开发者ID:nikolavp,项目名称:commander-shell,代码行数:56,代码来源:SSHD.java


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