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

Java ILogger类代码示例

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

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



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

示例1: fillDepenciesMap

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Fill a dependent tree
 * @param logger
 * @param node
 * @param dependenciesMap
 * @param identifierMap
 * @param indent
 */
private void fillDepenciesMap(ILogger logger, DependencyNode node, Multimap<String, String> dependenciesMap,
                              Map<String, String> identifierMap, int indent) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < indent; i++) {
        sb.append(" ");
    }
    sb.append(node.name);
    if (null != logger) {
        logger.verbose(sb.toString());
    }

    dependenciesMap.put(node.name, node.identifier);
    identifierMap.put(node.identifier, node.name);
    for (DependencyNode child : node.children) {
        fillDepenciesMap(logger, child, dependenciesMap, identifierMap, indent + 1);
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:26,代码来源:CircleDependencyCheck.java


示例2: AtlasBuilder

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Creates an AndroidBuilder.
 * <p/>
 * <var>verboseExec</var> is needed on top of the ILogger due to remote exec tools not being
 * able to output info and verbose messages separately.
 *
 * @param projectId
 * @param createdBy           the createdBy String for the apk manifest.
 * @param processExecutor
 * @param javaProcessExecutor
 * @param errorReporter
 * @param logger              the Logger
 * @param verboseExec         whether external tools are launched in verbose mode
 */
public AtlasBuilder(@NonNull String projectId,
                    @Nullable String createdBy,
                    @NonNull ProcessExecutor processExecutor,
                    @NonNull JavaProcessExecutor javaProcessExecutor,
                    @NonNull ErrorReporter errorReporter,
                    @NonNull ILogger logger,
                    boolean verboseExec) {
    super(projectId,
          createdBy,
          processExecutor,
          javaProcessExecutor,
          errorReporter,
          logger,
          verboseExec);
    this.javaProcessExecutor = javaProcessExecutor;
    this.verboseExec = verboseExec;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:32,代码来源:AtlasBuilder.java


示例3: createManager

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Creates an {@link SdkManager} for a given sdk location.
 * @param osSdkPath the location of the SDK.
 * @param log the ILogger object receiving warning/error from the parsing.
 * @return the created {@link SdkManager} or null if the location is not valid.
 */
@Nullable
public static SdkManager createManager(
        @NonNull String osSdkPath,
        @NonNull ILogger log) {
    try {
        SdkManager manager = new SdkManager(osSdkPath);
        manager.reloadSdk(log);

        return manager;
    } catch (Throwable throwable) {
        log.error(throwable, "Error parsing the sdk.");
    }

    return null;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:22,代码来源:SdkManager.java


示例4: updateAvd

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Updates an AVD with new path to the system image folders.
 * @param name the name of the AVD to update.
 * @param log the log object to receive action logs. Cannot be null.
 * @throws IOException
 */
public void updateAvd(String name, ILogger log) throws IOException {
    // find the AVD to update. It should be be in the broken list.
    AvdInfo avd = null;
    synchronized (mAllAvdList) {
        for (AvdInfo info : mAllAvdList) {
            if (info.getName().equals(name)) {
                avd = info;
                break;
            }
        }
    }

    if (avd == null) {
        // not in the broken list, just return.
        log.error(null, "There is no Android Virtual Device named '%s'.", name);
        return;
    }

    updateAvd(avd, log);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:27,代码来源:AvdManager.java


示例5: CommandLineParser

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Constructs a new command-line processor.
 *
 * @param logger An SDK logger object. Must not be null.
 * @param actions The list of actions recognized on the command-line.
 *                See the javadoc of {@link #mActions} for more details.
 *
 * @see #mActions
 */
public CommandLineParser(ILogger logger, String[][] actions) {
    mLog = logger;
    mActions = actions;

    /*
     * usage should fit in 80 columns, including the space to print the options:
     * "  -v --verbose  7890123456789012345678901234567890123456789012345678901234567890"
     */

    define(Mode.BOOLEAN, false, GLOBAL_FLAG_VERB, NO_VERB_OBJECT, "v", KEY_VERBOSE,
                       "Verbose mode, shows errors, warnings and all messages.",
                       false);
    define(Mode.BOOLEAN, false, GLOBAL_FLAG_VERB, NO_VERB_OBJECT, "s", KEY_SILENT,
                       "Silent mode, shows errors only.",
                       false);
    define(Mode.BOOLEAN, false, GLOBAL_FLAG_VERB, NO_VERB_OBJECT, "h", KEY_HELP,
                       "Help on a specific command.",
                       false);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:29,代码来源:CommandLineParser.java


示例6: isValid

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:25,代码来源:BuildToolInfo.java


示例7: parseFolder

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Reads the content of a typed resource folder (sub folder to the root of res folder), and
 * loads the resources from it.
 *
 *
 * @param sourceFolder the main res folder
 * @param folder the folder to read.
 * @param folderData the folder Data
 * @param logger a logger object
 *
 * @throws MergingException if something goes wrong
 */
private void parseFolder(File sourceFolder, File folder, FolderData folderData, ILogger logger)
        throws MergingException {
    File[] files = folder.listFiles();
    if (files != null && files.length > 0) {
        for (File file : files) {
            if (!file.isFile() || isIgnored(file)) {
                continue;
            }

            ResourceFile resourceFile = createResourceFile(file, folderData, logger);
            if (resourceFile != null) {
                processNewDataFile(sourceFolder, resourceFile, true /*setTouched*/);
            }
        }
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:29,代码来源:ResourceSet.java


示例8: updateWith

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Update the DataSet with a given file.
 *
 * @param sourceFolder the sourceFile containing the changedFile
 * @param changedFile The changed file
 * @param fileStatus the change state
 * @return true if the set was properly updated, false otherwise
 * @throws MergingException if something goes wrong
 */
public boolean updateWith(File sourceFolder, File changedFile, FileStatus fileStatus,
                          ILogger logger)
        throws MergingException {
    switch (fileStatus) {
        case NEW:
            return handleNewFile(sourceFolder, changedFile, logger);
        case CHANGED:
            return handleChangedFile(sourceFolder, changedFile);
        case REMOVED:
            F dataFile = mDataFileMap.get(changedFile);

            if (dataFile == null) {
                return false;
            }

            // flag all resource items are removed
            for (I dataItem : dataFile.getItems()) {
                dataItem.setRemoved();
            }
            return true;
    }

    return false;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:34,代码来源:DataSet.java


示例9: log

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:22,代码来源:MergingReport.java


示例10: ManifestMerger2

import com.android.utils.ILogger; //导入依赖的package包/类
private ManifestMerger2(
        @NonNull ILogger logger,
        @NonNull File mainManifestFile,
        @NonNull ImmutableList<Pair<String, File>> libraryFiles,
        @NonNull ImmutableList<File> flavorsAndBuildTypeFiles,
        @NonNull ImmutableList<Invoker.Feature> optionalFeatures,
        @NonNull Map<String, Object> placeHolderValues,
        @NonNull KeyBasedValueResolver<SystemProperty> systemPropertiesResolver,
        @NonNull MergeType mergeType,
        @NonNull Optional<File> reportFile) {
    this.mSystemPropertyResolver = systemPropertiesResolver;
    this.mPlaceHolderValues = placeHolderValues;
    this.mManifestFile = mainManifestFile;
    this.mLogger = logger;
    this.mLibraryFiles = libraryFiles;
    this.mFlavorsAndBuildTypeFiles = flavorsAndBuildTypeFiles;
    this.mOptionalFeatures = optionalFeatures;
    this.mMergeType = mergeType;
    this.mReportFile = reportFile;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:21,代码来源:ManifestMerger2.java


示例11: ArgvParser

import com.android.utils.ILogger; //导入依赖的package包/类
public ArgvParser(ILogger logger) {
    super(logger, ACTIONS);

    // The following defines the parameters of the actions defined in mAction.

    // --- merge manifest ---

    define(Mode.STRING, true,
            VERB_MERGE, NO_VERB_OBJECT, "o", KEY_OUT,                           //$NON-NLS-1$
            "Output path (where to write the merged manifest). Use - for stdout.", null);

    define(Mode.STRING, true,
            VERB_MERGE, NO_VERB_OBJECT, "1", KEY_MAIN,                          //$NON-NLS-1$
            "Path of the main manifest (what to merge *into*)", null);

    define(Mode.STRING_ARRAY, true,
            VERB_MERGE, NO_VERB_OBJECT, "2", KEY_LIBS,                          //$NON-NLS-1$
            "Paths of library manifests to be merged into the main one.",
            null);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:21,代码来源:ArgvParser.java


示例12: parse

import com.android.utils.ILogger; //导入依赖的package包/类
@Override
public boolean parse(@NonNull String line, @NonNull OutputLineReader reader, @NonNull List<Message> messages, @NonNull ILogger logger)
        throws ParsingFailedException {
    Matcher m = MSG_PATTERNS.get(0).matcher(line);
    if (!m.matches()) {
        return false;
    }
    String lineNumber = m.group(1);
    String msgText = m.group(2);

    m = getNextLineMatcher(reader, MSG_PATTERNS.get(1));
    if (m == null) {
        throw new ParsingFailedException();
    }
    String sourcePath = m.group(1);

    Message msg = createMessage(Message.Kind.ERROR, msgText, sourcePath,
            lineNumber, "", logger);
    messages.add(msg);
    return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:Error1Parser.java


示例13: installPackages

import com.android.utils.ILogger; //导入依赖的package包/类
@Override
public void installPackages(@NonNull List<File> splitApkFiles,
        @NonNull Collection<String> options,
        int timeoutInMs,
        ILogger logger)
        throws DeviceException {

    List<String> apkFileNames = Lists.transform(splitApkFiles, new Function<File, String>() {
        @Override
        public String apply(@Nullable File input) {
            return input != null ? input.getAbsolutePath() : null;
        }
    });
    try {
        iDevice.installPackages(apkFileNames, timeoutInMs, true /*reinstall*/,
                options.isEmpty() ? null : options.toArray(new String[options.size()]));
    } catch (Exception e) {
        logger.error(e, "Unable to install " + Joiner.on(',').join(apkFileNames));
        throw new DeviceException(e);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ConnectedDevice.java


示例14: parse

import com.android.utils.ILogger; //导入依赖的package包/类
@Override
public boolean parse(@NonNull String line,
        @NonNull OutputLineReader reader,
        @NonNull List<Message> messages,
        @NonNull ILogger logger) throws ParsingFailedException {
    Matcher m = MSG_PATTERN.matcher(line);
    if (!m.matches()) {
        return false;
    }
    String json = m.group(1);
    if (json.trim().isEmpty()) {
        return false;
    }

    GsonBuilder gsonBuilder = new GsonBuilder();
    MessageJsonSerializer.registerTypeAdapters(gsonBuilder);
    Gson gson = gsonBuilder.create();
    try {
        Message msg = gson.fromJson(json, Message.class);
        messages.add(msg);
        return true;
    } catch (JsonParseException e) {
        throw new ParsingFailedException(e);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JsonEncodedGradleMessageParser.java


示例15: loadFromFiles

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Loads the DataSet from the files its source folders contain.
 *
 * All loaded items are set to TOUCHED. This is so that after loading the resources from
 * the files, they can be written directly (since touched force them to be written).
 *
 * This also checks for duplicates items.
 *
 * @throws MergingException if something goes wrong
 */
public void loadFromFiles(ILogger logger) throws MergingException {
    List<Message> errors = Lists.newArrayList();
    for (File file : mSourceFiles) {
        if (file.isDirectory()) {
            try {
                readSourceFolder(file, logger);
            } catch (MergingException e) {
                errors.addAll(e.getMessages());
            }

        } else if (file.isFile()) {
            // TODO support resource bundle
        }
    }
    MergingException.throwIfNonEmpty(errors);
    checkItems();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:DataSet.java


示例16: parse

import com.android.utils.ILogger; //导入依赖的package包/类
@Override
public boolean parse(@NotNull String line, @NotNull OutputLineReader reader, @NotNull List<Message> messages, @NotNull ILogger logger)
  throws ParsingFailedException {
  Matcher m1 = ERROR.matcher(line);
  if (!m1.matches()) {
    return false;
  }
  String stackTrace = ParserUtil.digestStackTrace(reader);
  if (stackTrace == null) {
    return false;
  }
  Matcher m2 = ALREADY_ADDED_EXCEPTION.matcher(stackTrace);
  if (!m2.matches()) {
    return false;
  }
  String message = String.format("Class %1s has already been added to output. Please remove duplicate copies.",
                                 m2.group(1).replace('/', '.').replace('$', '.'));
  messages.add(new Message(Message.Kind.ERROR, message, new SourceFilePosition(SourceFile.UNKNOWN, SourcePosition.UNKNOWN)));
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DexExceptionParser.java


示例17: createSdkAvdManagers

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Recreate the SDK and AVD Managers from scratch even if they already existed.
 * Useful for tests that want to reset their state without recreating the
 * android-home or the fake SDK. The SDK will be reparsed.
 */
protected void createSdkAvdManagers() throws AndroidLocationException {
    mSdkManager = SdkManager.createManager(mFakeSdk.getAbsolutePath(), mLog);
    assertNotNull("SdkManager location was invalid", mSdkManager);
    // Note: it's safe to use the default AvdManager implementation since makeFakeAndroidHome
    // above overrides the ANDROID_HOME folder to use a temp folder; consequently all
    // the AVDs created here will be located in this temp folder and will not alter
    // or pollute the default user's AVD folder.
    mAvdManager = new AvdManager(mSdkManager.getLocalSdk(), mLog) {
        @Override
        protected boolean createSdCard(
                String toolLocation,
                String size,
                String location,
                ILogger log) {
            if (new File(toolLocation).exists()) {
                log.info("[EXEC] %1$s %2$s %3$s\n", toolLocation, size, location);
                return true;
            } else {
                log.error(null, "Failed to create the SD card.\n");
                return false;
            }

        };
    };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:SdkManagerTestCase.java


示例18: MockCommandLineProcessor

import com.android.utils.ILogger; //导入依赖的package包/类
public MockCommandLineProcessor(ILogger logger) {
    super(logger,
          new String[][] {
            { "verb1", "action1", "Some action" },
            { "verb1", "action2", "Another action" },
            { "verb2", NO_VERB_OBJECT, "Action with string array" },
    });
    define(Mode.STRING, false /*mandatory*/,
            "verb1", "action1", "1", "first", "non-mandatory flag", null);
    define(Mode.STRING, true /*mandatory*/,
            "verb1", "action1", "2", "second", "mandatory flag", null);

    define(Mode.STRING, true /*mandatory*/,
            "verb2", NO_VERB_OBJECT, "1", "first", "1st mandatory flag", null);
    define(Mode.STRING_ARRAY, true /*mandatory*/,
            "verb2", NO_VERB_OBJECT, "2", "second", "2nd mandatory flag", null);
    define(Mode.STRING, true /*mandatory*/,
            "verb2", NO_VERB_OBJECT, "3", "third", "3rd mandatory flag", null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:CommandLineParserTest.java


示例19: getSingleService

import com.android.utils.ILogger; //导入依赖的package包/类
/**
 * Return the first service instance for the requested service type or
 * {@link Optional#absent()} if none exist.
 * @param logger to log resolution.
 * @param serviceType the requested service type encapsulation.
 * @param <T> the requested service class type.
 * @return the instance of T or null of none exist in this context.
 * @throws ClassNotFoundException
 */
@NonNull
public synchronized <T> Optional<T> getSingleService(
        ILogger logger,
        Service<T> serviceType) throws ClassNotFoundException {
    logger.verbose("Looking for %1$s", serviceType);
    ServiceLoader<T> serviceLoader = getServiceLoader(serviceType);
    logger.verbose("Got a serviceLoader %1$d",
            Integer.toHexString(System.identityHashCode(serviceLoader)));
    Iterator<T> serviceIterator = serviceLoader.iterator();
    logger.verbose("Service Iterator =  %1$s ", serviceIterator);
    if (serviceIterator.hasNext()) {
        T service = serviceIterator.next();
        logger.verbose("Got it from %1$s, loaded service = %2$s, type = %3$s",
                serviceIterator, service, service.getClass());
        return Optional.of(service);
    } else {
        logger.info("Cannot find service implementation %1$s" + serviceType);
        return Optional.absent();
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:BuildToolsServiceLoader.java


示例20: parse

import com.android.utils.ILogger; //导入依赖的package包/类
@Override
public boolean parse(@NonNull String line, @NonNull OutputLineReader reader, @NonNull List<Message> messages, @NonNull ILogger logger)
        throws ParsingFailedException {
    Matcher m = MSG_PATTERNS.get(0).matcher(line);
    if (!m.matches()) {
        return false;
    }
    String sourcePath = m.group(1);

    m = getNextLineMatcher(reader, MSG_PATTERNS.get(1));
    if (m == null) {
        throw new ParsingFailedException();
    }
    String msgText = m.group(1);
    String lineNumber = m.group(2);

    Message msg = createMessage(Message.Kind.ERROR, msgText, sourcePath,
            lineNumber, "", logger);
    messages.add(msg);
    return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:Error4Parser.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java IllegalInstantException类代码示例发布时间:2022-05-22
下一篇:
Java DAOImpl类代码示例发布时间: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