本文整理汇总了Java中org.apache.ivy.util.Message.MSG_WARN属性的典型用法代码示例。如果您正苦于以下问题:Java Message.MSG_WARN属性的具体用法?Java Message.MSG_WARN怎么用?Java Message.MSG_WARN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.ivy.util.Message
的用法示例。
在下文中一共展示了Message.MSG_WARN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log
@Override
public void log(String message, int level) {
message = "[Ivy] " + message.trim();
switch (level) {
case Message.MSG_ERR:
JkLog.error(message);
break;
case Message.MSG_WARN:
JkLog.warn(message);
break;
case Message.MSG_INFO:
JkLog.info(message);
break;
case Message.MSG_VERBOSE:
JkLog.trace(message);
break;
case Message.MSG_DEBUG:
JkLog.trace(message);
break;
default:
JkLog.info("[" + level + "] " + message);
}
}
示例2: log
public static void log(int logLevel, String msg) {
switch (logLevel) {
case Message.MSG_DEBUG:
debug(msg);
break;
case Message.MSG_VERBOSE:
verbose(msg);
break;
case Message.MSG_INFO:
info(msg);
break;
case Message.MSG_WARN:
warn(msg);
break;
case Message.MSG_ERR:
error(msg);
break;
default:
throw new IllegalArgumentException("Unknown log level " + logLevel);
}
}
示例3: writeManifests
public static void writeManifests(Iterable<ManifestAndLocation> manifestAndLocations,
ContentHandler handler, boolean quiet) throws SAXException {
int level = quiet ? Message.MSG_DEBUG : Message.MSG_WARN;
handler.startDocument();
AttributesImpl atts = new AttributesImpl();
handler.startElement("", RepositoryHandler.REPOSITORY, RepositoryHandler.REPOSITORY, atts);
int nbOk = 0;
int nbRejected = 0;
for (ManifestAndLocation manifestAndLocation : manifestAndLocations) {
BundleInfo bundleInfo;
try {
bundleInfo = ManifestParser.parseManifest(manifestAndLocation.getManifest());
bundleInfo
.addArtifact(new BundleArtifact(false, manifestAndLocation.getUri(), null));
if (manifestAndLocation.getSourceURI() != null) {
bundleInfo.addArtifact(new BundleArtifact(true, manifestAndLocation
.getSourceURI(), null));
}
nbOk++;
} catch (ParseException e) {
nbRejected++;
IvyContext
.getContext()
.getMessageLogger()
.log("Rejected " + manifestAndLocation.getUri() + ": " + e.getMessage(),
level);
continue;
}
saxBundleInfo(bundleInfo, handler);
}
handler.endElement("", RepositoryHandler.REPOSITORY, RepositoryHandler.REPOSITORY);
handler.endDocument();
Message.info(nbOk + " bundle" + (nbOk > 1 ? "s" : "") + " added, " + nbRejected + " bundle"
+ (nbRejected > 1 ? "s" : "") + " rejected.");
}