Java Code Examples for com.android.utils.ILogger#warning()

The following examples show how to use com.android.utils.ILogger#warning() . 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: BuildToolInfo.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether the build-tool is valid by verifying that the expected binaries
 * are actually present. This checks that all known paths point to a valid file
 * or directory.
 *
 * @param log An optional logger. If non-null, errors will be printed there.
 * @return True if the build-tool folder contains all the expected tools.
 */
public boolean isValid(@Nullable ILogger log) {
    for (Map.Entry<PathId, String> entry : mPaths.entrySet()) {
        File f = new File(entry.getValue());
        // check if file is missing. It's only ok if the revision of the build-tools
        // is lower than the min rev of the element.
        if (!f.exists() && entry.getKey().isPresentIn(mRevision)) {
            if (log != null) {
                log.warning("Build-tool %1$s is missing %2$s at %3$s",  //$NON-NLS-1$
                        mRevision.toString(),
                        entry.getKey(), f.getAbsolutePath());
            }
            return false;
        }
    }
    return true;
}
 
Example 2
Source File: MergingReport.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * dumps all logging records to a logger.
 */
public void log(ILogger logger) {
    for (Record record : mRecords) {
        switch(record.mSeverity) {
            case WARNING:
                logger.warning(record.toString());
                break;
            case ERROR:
                logger.error(null /* throwable */, record.toString());
                break;
            case INFO:
                logger.verbose(record.toString());
                break;
            default:
                logger.error(null /* throwable */, "Unhandled record type " + record.mSeverity);
        }
    }
    mActions.log(logger);
}
 
Example 3
Source File: MergingReport.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * dumps all logging records to a logger.
 */
public void log(ILogger logger) {
    for (Record record : mRecords) {
        switch(record.mSeverity) {
            case WARNING:
                logger.warning(record.toString());
                break;
            case ERROR:
                logger.error(null /* throwable */, record.toString());
                break;
            case INFO:
                logger.verbose(record.toString());
                break;
            default:
                logger.error(null /* throwable */, "Unhandled record type " + record.mSeverity);
        }
    }
    mActions.log(logger);

    if (!mResult.isSuccess()) {
        logger.warning("\nSee http://g.co/androidstudio/manifest-merger for more information"
                + " about the manifest merger.\n");
    }
}
 
Example 4
Source File: BuildToolInfo.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Checks whether the build-tool is valid by verifying that the expected binaries
 * are actually present. This checks that all known paths point to a valid file
 * or directory.
 *
 * @param log An optional logger. If non-null, errors will be printed there.
 * @return True if the build-tool folder contains all the expected tools.
 */
public boolean isValid(@Nullable ILogger log) {
    for (Map.Entry<PathId, String> entry : mPaths.entrySet()) {
        File f = new File(entry.getValue());
        // check if file is missing. It's only ok if the revision of the build-tools
        // is lower than the min rev of the element.
        if (!f.exists() && entry.getKey().isPresentIn(mRevision)) {
            if (log != null) {
                log.warning("Build-tool %1$s is missing %2$s at %3$s",  //$NON-NLS-1$
                        mRevision.toString(),
                        entry.getKey(), f.getAbsolutePath());
            }
            return false;
        }
    }
    return true;
}
 
Example 5
Source File: LoggingUtil.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public static void displayWarning(ILogger logger, Project project, String message) {
    logger.warning(createWarning(project.getPath(), message));
}