Java Code Examples for com.intellij.openapi.diagnostic.Logger#info()
The following examples show how to use
com.intellij.openapi.diagnostic.Logger#info() .
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: PantsTargetNamesShortenerModifier.java From intellij-pants-plugin with Apache License 2.0 | 5 votes |
@Override public void modify(@NotNull ProjectInfo projectInfo, @NotNull PantsCompileOptionsExecutor executor, @NotNull Logger log) { final List<String> longTargetNames = projectInfo.getTargets() .keySet() .stream() .filter(s -> s.length() > MAX_MODULE_NAME_LENGTH) .collect(Collectors.toList()); for (String targetName : longTargetNames) { final String newTargetName = StringUtil.trimMiddle(targetName, MAX_MODULE_NAME_LENGTH); log.info(targetName + " is too long! Will replace with " + newTargetName); projectInfo.renameTarget(targetName, newTargetName); } }
Example 2
Source File: PantsCyclicDependenciesModifier.java From intellij-pants-plugin with Apache License 2.0 | 5 votes |
@Override public void modify(@NotNull ProjectInfo projectInfo, @NotNull PantsCompileOptionsExecutor executor, @NotNull Logger log) { final Set<Map.Entry<String, TargetInfo>> originalEntries = new HashSet<>(projectInfo.getTargets().entrySet()); for (Map.Entry<String, TargetInfo> nameAndInfo : originalEntries) { final String targetName = nameAndInfo.getKey(); final TargetInfo targetInfo = nameAndInfo.getValue(); if (!projectInfo.getTargets().containsKey(targetName)) { // already removed continue; } for (String dependencyTargetName : targetInfo.getTargets()) { TargetInfo dependencyTargetInfo = projectInfo.getTarget(dependencyTargetName); if (dependencyTargetInfo != null && dependencyTargetInfo.dependOn(targetName)) { if (targetName.equals(dependencyTargetName)) { throw new PantsException(String.format("Self cyclic dependency found %s", targetName)); } log.info(String.format("Found cyclic dependency between %s and %s", targetName, dependencyTargetName)); final String combinedTargetName = combinedTargetsName(targetName, dependencyTargetName); final TargetInfo combinedInfo = targetInfo.union(dependencyTargetInfo); combinedInfo.removeDependency(targetName); combinedInfo.removeDependency(dependencyTargetName); projectInfo.addTarget(combinedTargetName, combinedInfo); projectInfo.replaceDependency(targetName, combinedTargetName); projectInfo.removeTarget(targetName); projectInfo.replaceDependency(dependencyTargetName, combinedTargetName); projectInfo.removeTarget(dependencyTargetName); } } } }
Example 3
Source File: DslCompilerService.java From dsl-compiler-client with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void setupCompiler(Logger logger, DslContext context) throws InterruptedException { if (!Main.processContext(context, Arrays.<CompileParameter>asList(Download.INSTANCE, DslCompiler.INSTANCE))) { logger.warn("Unable to setup DSL Platform client"); } final String path = context.get(DslCompiler.INSTANCE); if (path == null) { logger.error("Unable to setup dsl-compiler.exe. Please check if Mono/.NET is installed and available on path."); } else { final File compiler = new File(path); logger.info("DSL Platform compiler found at: " + compiler.getAbsolutePath()); Either<DslCompiler.TokenParser> trySetup = DslCompiler.setupServer(context, compiler); if (trySetup.isSuccess()) { tokenParser = trySetup.get(); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { try { tokenParser.close(); tokenParser = null; } catch (Exception ignore) { } } })); Thread.sleep(2000); for (Runnable r : notifications) { r.run(); } } } }