• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LogLevel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.tools.ant.types.LogLevel的典型用法代码示例。如果您正苦于以下问题:Java LogLevel类的具体用法?Java LogLevel怎么用?Java LogLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LogLevel类属于org.apache.tools.ant.types包,在下文中一共展示了LogLevel类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: VictimsTask

import org.apache.tools.ant.types.LogLevel; //导入依赖的package包/类
/**
 * Task constructor, Initialises the context with default settings and
 * creates the log, cache and database.
 */
public VictimsTask() {
	/* Set up the execution context */
	ctx = new ExecutionContext();
	ctx.setSettings(new Settings());
	ctx.setLog(new LogOutputResource(this));

	/* Initialise the default settings */
	ctx.getSettings().set(VictimsConfig.Key.URI, baseUrl);
	ctx.getSettings().set(VictimsConfig.Key.DB_DRIVER, jdbcDriver);
	ctx.getSettings().set(VictimsConfig.Key.DB_URL, jdbcUrl);
	ctx.getSettings().set(Settings.METADATA, metadata);
	ctx.getSettings().set(Settings.FINGERPRINT, fingerprint);
	ctx.getSettings().set(VictimsConfig.Key.ENTRY, entryPoint);
	ctx.getSettings().set(VictimsConfig.Key.DB_USER, jdbcUser);
	ctx.getSettings().set(VictimsConfig.Key.DB_PASS, jdbcPass);
	ctx.getSettings().set(Settings.UPDATE_DATABASE, updates);

	// Only need to query using one hashing mechanism
	System.setProperty(VictimsConfig.Key.ALGORITHMS, "SHA512");

	/* Create results cache & victims DB */
	try {
		VictimsResultCache cache = new VictimsResultCache();
		ctx.setCache(cache);

	} catch (VictimsException e) {
		log(e, LogLevel.DEBUG.getLevel());
		throw new VictimsBuildException(e.getMessage());
	}
}
 
开发者ID:victims,项目名称:victims-plugin-ant-legacy,代码行数:35,代码来源:VictimsTask.java


示例2: updateDatabase

import org.apache.tools.ant.types.LogLevel; //导入依赖的package包/类
/**
 * Updates the database according to the given configuration
 * 
 * @param ctx
 * @throws VictimsException
 */
public void updateDatabase(ExecutionContext ctx) throws VictimsException {

	VictimsDBInterface db = ctx.getDatabase();
	LogOutputResource log = ctx.getLog();

	Date updated = db.lastUpdated();

	// update automatically every time
	if (ctx.updateAlways()) {
		log.log(TextUI.fmt(Resources.INFO_UPDATES, updated.toString(),
				VictimsConfig.uri()), LogLevel.INFO.getLevel());
		db.synchronize();

		// update once per day
	} else if (ctx.updateDaily()) {

		Date today = new Date();
		SimpleDateFormat cmp = new SimpleDateFormat("yyyMMdd");
		boolean updatedToday = cmp.format(today)
				.equals(cmp.format(updated));

		if (!updatedToday) {
			log.log(TextUI.fmt(Resources.INFO_UPDATES, updated.toString(),
					VictimsConfig.uri()), LogLevel.INFO.getLevel());
			db.synchronize();

		} else {
			log.log("Database last synchronized: " + updated.toString(),
					LogLevel.DEBUG.getLevel());
		}

		// updates disabled
	} else {
		log.log("Database synchronization disabled.",
				LogLevel.INFO.getLevel());
	}

}
 
开发者ID:victims,项目名称:victims-plugin-ant-legacy,代码行数:45,代码来源:VictimsTask.java


示例3: show

import org.apache.tools.ant.types.LogLevel; //导入依赖的package包/类
/**
 * Use the supplied log to display the current settings.
 * @param log Log to send output to.
 */
public void show(LogOutputResource log) {
  StringBuilder info = new StringBuilder();
  info.append(TextUI.box(TextUI.fmt(Resources.INFO_SETTINGS_HEADING)));
  for (Entry<String, String> kv : settings.entrySet()){
    info.append(String.format("%-12s = %s\n", kv.getKey(), kv.getValue()));
  }
  log.log(info.toString(), LogLevel.INFO.getLevel());

}
 
开发者ID:victims,项目名称:victims-plugin-ant-legacy,代码行数:14,代码来源:Settings.java


示例4: execute

import org.apache.tools.ant.types.LogLevel; //导入依赖的package包/类
@Override
public void execute() throws BuildException {
    if (projectFile == null || platformFolder == null) {
        throw new BuildException("Please set projectfile and version");
    }
    clearVesionMap();
    gatherVersionMap(platformFolder);
    try {
        boolean change = false;
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(projectFile);
        Element project = doc.getDocumentElement();
        if (project == null) {
            return;
        }
        Element configuration = findChildElement(project, "configuration");
        if (configuration == null) {
            return;
        }
        Element data = findChildElement(configuration, "data");
        if (data == null) {
            return;
        }
        Element deps = findChildElement(data, "module-dependencies");
        if (deps == null) {
            return;
        }
        NodeList list = deps.getElementsByTagName("dependency");
        for (int i = 0; i < list.getLength(); i++) {
            Element elem = (Element) list.item(i);
            Element base = findChildElement(elem, "code-name-base");
            if (base != null) {
                Element runDep = findChildElement(elem, "run-dependency");
                if (runDep != null) {
                    Element specVersion = findChildElement(runDep, "specification-version");
                    if (specVersion != null) {
                        String name = base.getTextContent().trim();
                        String version = specVersion.getTextContent().trim();
                        String newVersion = versionMap.get(name);
                        if (newVersion != null && !newVersion.equals(version)) {
                            specVersion.setTextContent(newVersion);
                            change = true;
                            log("Updating dependency in for " + name + " to " + newVersion);
                        } else {
                            if(newVersion == null){
                                log("Unknown " + name + ", cannot update dependency.", LogLevel.WARN.getLevel());
                            }else{
                                log("Dependency " + name + " is up to date.", LogLevel.INFO.getLevel());
                            }
                        }
                    }
                }
            }
        }
        if (change) {
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            DOMSource source = new DOMSource(doc);
            StreamResult result = new StreamResult(projectFile);
            transformer.transform(source, result);
            OutputStreamWriter out = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(projectFile, true)));
            out.write("\n");
            out.close();
        }
    } catch (Exception ex) {
        throw new BuildException("Error changing file: " + ex);
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:68,代码来源:UpdateNetBeansDependencies.java


示例5: publish

import org.apache.tools.ant.types.LogLevel; //导入依赖的package包/类
@Override
public void publish( LogRecord record ) {
    task.log(record.getMessage(), LogLevel.INFO.getLevel());

}
 
开发者ID:joker535,项目名称:Baffle,代码行数:6,代码来源:AntLogHandle.java



注:本文中的org.apache.tools.ant.types.LogLevel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DelayInformation类代码示例发布时间:2022-05-22
下一篇:
Java CodePointCharStream类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap