Java Code Examples for org.apache.ivy.util.Message#MSG_DEBUG

The following examples show how to use org.apache.ivy.util.Message#MSG_DEBUG . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IvyMessageLogger.java    From jeka with Apache License 2.0 6 votes vote down vote up
@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:
        if (JkLog.Verbosity.QUITE_VERBOSE.equals(JkLog.verbosity())) {
            JkLog.trace(message);
        }
        break;
    default:
        JkLog.info("[" + level + "] " + message);
    }

}
 
Example 2
Source File: EditableRepoDescriptor.java    From ant-ivy with Apache License 2.0 6 votes vote down vote up
private void add(String type, String value, ModuleDescriptorWrapper md) {
    modules.add(md);
    Map<String, Set<ModuleDescriptorWrapper>> map = moduleByCapabilities.get(type);
    if (map == null) {
        map = new HashMap<>();
        moduleByCapabilities.put(type, map);
    }
    Set<ModuleDescriptorWrapper> bundleReferences = map.get(value);
    if (bundleReferences == null) {
        bundleReferences = new HashSet<>();
        map.put(value, bundleReferences);
    }
    if (!bundleReferences.add(md)) {
        if (logLevel <= Message.MSG_DEBUG) {
            Message.debug("Duplicate module in the repo " + baseUri + " for " + type + " "
                    + value + ": " + md.getBundleInfo().getSymbolicName() + "#"
                    + md.getBundleInfo().getVersion());
        }
    }
}
 
Example 3
Source File: OBRXMLWriter.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
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.");
}