當前位置: 首頁>>代碼示例>>Java>>正文


Java Logger.info方法代碼示例

本文整理匯總了Java中org.gradle.api.logging.Logger.info方法的典型用法代碼示例。如果您正苦於以下問題:Java Logger.info方法的具體用法?Java Logger.info怎麽用?Java Logger.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.gradle.api.logging.Logger的用法示例。


在下文中一共展示了Logger.info方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: waitForInitialDeviceList

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
/**
 * Wait for the Android Debug Bridge to return an initial device list.
 */
protected static void waitForInitialDeviceList(final AndroidDebugBridge androidDebugBridge, Logger logger) {
    if (!androidDebugBridge.hasInitialDeviceList()) {
        logger.info("Waiting for initial device list from the Android Debug Bridge");
        long limitTime = System.currentTimeMillis() + ADB_TIMEOUT_MS;
        while (!androidDebugBridge.hasInitialDeviceList() && (System.currentTimeMillis() < limitTime)) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException("Interrupted waiting for initial device list from Android Debug Bridge");
            }
        }
        if (!androidDebugBridge.hasInitialDeviceList()) {
            logger.error("Did not receive initial device list from the Android Debug Bridge.");
        }
    }
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:20,代碼來源:AwoInstaller.java

示例2: apply

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
@Override
public void apply(final Project project) {
	Logger logger = project.getLogger();
	logger.info("applying jsweet plugin");

	if (!project.getPlugins().hasPlugin(JavaPlugin.class) && !project.getPlugins().hasPlugin(WarPlugin.class)) {
		logger.error("No java or war plugin detected. Enable java or war plugin.");
		throw new IllegalStateException("No java or war plugin detected. Enable java or war plugin.");
	}

	JSweetPluginExtension extension = project.getExtensions().create("jsweet", JSweetPluginExtension.class);

	JavaPluginConvention javaPluginConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
	SourceSetContainer sourceSets = javaPluginConvention.getSourceSets();
	SourceSet mainSources = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME);

	JSweetTranspileTask task = project.getTasks().create("jsweet", JSweetTranspileTask.class);
	task.setGroup("generate");
	task.dependsOn(JavaPlugin.COMPILE_JAVA_TASK_NAME);
	task.setConfiguration(extension);
	task.setSources(mainSources.getAllJava());
	task.setClasspath(mainSources.getCompileClasspath());
	
	JSweetCleanTask cleanTask = project.getTasks().create("jsweetClean", JSweetCleanTask.class);
	cleanTask.setConfiguration(extension);
}
 
開發者ID:lgrignon,項目名稱:jsweet-gradle-plugin,代碼行數:27,代碼來源:JSweetPlugin.java

示例3: getEv3Host

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
private String getEv3Host() {
    Logger logger = getLogger();
    LejosEv3PluginExtension ev3 = getEv3PluginExtension();
    String host;
    if (ev3.discoverBrickEnabled()) {
        BrickInfo brick;
        try {
            brick =  BrickFinder.discover()[0];
        } catch (IOException e) {
            throw new GradleException("Error on discovering bricks", e);
        }
        logger.info("Found brick " + brick.getName() + " at " + brick.getIPAddress());
        host = brick.getIPAddress();
    } else {
        if (ev3.getHost() == null) {
            throw new GradleException("Please set property ev3.host");
        }
        host = ev3.getHost();
    }
    return host;
}
 
開發者ID:mindstorms-cop,項目名稱:lejos-ev3-gradle-plugin,代碼行數:22,代碼來源:Ev3DeployTask.java

示例4: logHealth

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
public void logHealth(DaemonHealthStats stats, Logger logger) {
    if (Boolean.getBoolean(HEALTH_MESSAGE_PROPERTY)) {
        logger.lifecycle(stats.getHealthInfo());
    } else {
        //the default
        logger.info(stats.getHealthInfo());
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:9,代碼來源:HealthLogger.java

示例5: addLink

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
private void addLink(Javadoc javadoc, String link) {
    MinimalJavadocOptions options = javadoc.getOptions();
    if (options instanceof StandardJavadocDocletOptions) {
        StandardJavadocDocletOptions docletOptions = (StandardJavadocDocletOptions) options;
        Logger logger = javadoc.getLogger();
        List<String> links = docletOptions.getLinks();

        if (!links.contains(link)) {
            logger.debug("Adding '{}' to {}", link, javadoc);
            links.add(link);
        } else {
            logger.info("Not adding '{}' to {} because it's already present", link, javadoc);
        }
    }
}
 
開發者ID:freefair,項目名稱:gradle-plugins,代碼行數:16,代碼來源:JavadocLinksPlugin.java

示例6: shouldBundlerRun

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
private boolean shouldBundlerRun(String requestedBundler, String currentRunningBundlerID, JavaFXGradlePluginExtension ext, final Logger logger, Map<String, ? super Object> params) {
    if( requestedBundler != null && !"ALL".equalsIgnoreCase(requestedBundler) && !requestedBundler.equalsIgnoreCase(currentRunningBundlerID) ){
        // this is not the specified bundler
        return false;
    }

    if( ext.isSkipJNLP() && "jnlp".equalsIgnoreCase(currentRunningBundlerID) ){
        logger.info("Skipped JNLP-bundling as requested.");
        return false;
    }

    boolean runBundler = true;
    // Workaround for native installer bundle not creating working executable native launcher
    // (this is a comeback of issue 124)
    // https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/205
    // do run application bundler and put the cfg-file to application resources
    if( System.getProperty("os.name").toLowerCase().startsWith("linux") ){
        if( workarounds.isWorkaroundForBug205Needed() ){
            // check if special conditions for this are met (not jnlp, but not linux.app too, because another workaround already works)
            if( !"jnlp".equalsIgnoreCase(requestedBundler) && !"linux.app".equalsIgnoreCase(requestedBundler) && "linux.app".equalsIgnoreCase(currentRunningBundlerID) ){
                if( !ext.isSkipNativeLauncherWorkaround205() ){
                    logger.info("Detected linux application bundler ('linux.app') needs to run before installer bundlers are executed.");
                    runBundler = true;
                    params.put(CFG_WORKAROUND_MARKER, "true");
                } else {
                    logger.info("Skipped workaround for native linux installer bundlers.");
                }
            }
        }
    }
    return runBundler;
}
 
開發者ID:FibreFoX,項目名稱:javafx-gradle-plugin,代碼行數:33,代碼來源:JfxNativeWorker.java

示例7: downloadMcJson

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
public static void downloadMcJson(LoomGradleExtension extension, Logger logger) throws IOException {
	if (!Constants.MINECRAFT_JSON.get(extension).exists()) {
		logger.lifecycle(":downloading minecraft json");
		FileUtils.copyURLToFile(new URL("https://launchermeta.mojang.com/mc/game/version_manifest.json"), Constants.VERSION_MANIFEST.get(extension));
		ManifestVersion mcManifest = new GsonBuilder().create().fromJson(FileUtils.readFileToString(Constants.VERSION_MANIFEST.get(extension), "UTF-8"), ManifestVersion.class);

		Optional<ManifestVersion.Versions> optionalVersion = mcManifest.versions.stream().filter(versions -> versions.id.equalsIgnoreCase(extension.version)).findFirst();
		if (optionalVersion.isPresent()) {
			FileUtils.copyURLToFile(new URL(optionalVersion.get().url), Constants.MINECRAFT_JSON.get(extension));
		} else {
			logger.info(":failed downloading minecraft json");
			throw new RuntimeException("Failed downloading Minecraft json");
		}
	}
}
 
開發者ID:FabricMC,項目名稱:fabric-loom,代碼行數:16,代碼來源:DownloadTask.java

示例8: uninstall

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
@TaskAction
public void uninstall() throws DeviceException {
    final Logger logger = getLogger();
    final String applicationId = variant.getApplicationId();

    logger.info("Uninstalling app: {}", applicationId);

    final ILogger lifecycleLogger = new LoggerWrapper(getLogger(), LogLevel.LIFECYCLE);
    final DeviceProvider deviceProvider =
            new ConnectedDeviceProvider(getAdbExe(), lifecycleLogger);

    deviceProvider.init();
    final List<? extends DeviceConnector> devices = deviceProvider.getDevices();

    for (DeviceConnector device : devices) {
        device.uninstallPackage(applicationId, getTimeOutInMs(), getILogger());
        logger.lifecycle(
                "Uninstalling {} (from {}:{}) from device '{}' ({}).",
                applicationId, getProject().getName(),
                variant.getVariantConfiguration().getFullName(),
                device.getName(), device.getSerialNumber());
    }

    int n = devices.size();
    logger.quiet("Uninstalled {} from {} device{}.",
            applicationId, n, n == 1 ? "" : "s");

}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:UninstallTask.java

示例9: createJavaFilesFromSQL

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
@TaskAction
public void createJavaFilesFromSQL() {
	final Project project = getProject();
	final Gradle gradle = project.getGradle();
	gradle.addListener(this);
	final Logger logger = getLogger();
	logger.info(
		"Creating Java files from SQL files in '%s' and writing them to '%s'...",
		sourceDirectory,
		destinationDirectory
	);
	final File output = project.file(destinationDirectory);
	final FileTree files = project.files(sourceDirectory).getAsFileTree();
	if (files.isEmpty()) {
		logger.info("There are no files to be processed!");
	}
	files.visit(details -> {
		if (details.isDirectory()) {
			return;
		}
		TargetAPI api = defaultApi;
		final String fileName = details.getName();
		final List<String> parts = Splitter.on('.').splitToList(fileName);
		final int indexOfLastPart = parts.size() - 1;
		if (indexOfLastPart == 0) {
			return;
		}
		final String extension = parts.get(indexOfLastPart);
		if ("sql".equalsIgnoreCase(extension) == false) {
			return;
		}
		if (parts.size() > 2) {
			final int indexOfSecondLastPart = indexOfLastPart - 1;
			api = TargetAPI.valueOf(parts.get(indexOfSecondLastPart).toUpperCase());
		}
		final String className = parts.get(0);
		final RelativePath relative = details.getRelativePath();
		logger.info("Creating Java file from '%s'...", relative);
		final Path sqlFile = details.getFile().toPath();
		final Path javaFile = relative.replaceLastName(className + ".java").getFile(output).toPath();
		final String path = details.getPath();
		final String namespace = path.substring(0, path.lastIndexOf('/')).replace('/', '.');
		try {
			JavaClassWriter
				.newBuilder()
				.setTargetAPI(api)
				.setNamespace(namespace)
				.setClassName(className)
				.setReader(sqlFile)
				.setWriter(javaFile)
				.writeClass();
		} catch (IOException exception) {
			throw new RuntimeException(exception);
		}
	});
}
 
開發者ID:RyanHoldren,項目名稱:TypeSafeSQL,代碼行數:57,代碼來源:TypeSafeSQLTask.java

示例10: applyWorkaroundsAfterBundling

import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
private void applyWorkaroundsAfterBundling(String currentRunningBundlerID, final Logger logger, JavaFXGradlePluginExtension ext, String appName, Map<String, ? super Object> params, Project project) {
    // Workaround for "Native package for Ubuntu doesn't work"
    // https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/124
    // real bug: linux-launcher from oracle-jdk starting from 1.8.0u40 logic to determine .cfg-filename
    if( workarounds.isWorkaroundForBug124Needed() ){
        if( "linux.app".equals(currentRunningBundlerID) ){
            logger.info("Applying workaround for oracle-jdk-bug since 1.8.0u40 regarding native linux launcher(s).");
            if( !ext.isSkipNativeLauncherWorkaround124() ){
                List<NativeLauncher> nativeLaunchers = new ArrayList<>();

                // bugfix for #24 "NullPointerException on linux without secondary launchers"
                Optional.ofNullable(ext.getSecondaryLaunchers()).ifPresent(launchers -> {
                    nativeLaunchers.addAll(launchers.stream().map(launcherMap -> getNativeLauncher(launcherMap)).collect(Collectors.toList()));
                });

                workarounds.applyWorkaround124(appName, nativeLaunchers);
                // only apply workaround for issue 205 when having workaround for issue 124 active
                if( Boolean.parseBoolean(String.valueOf(params.get(CFG_WORKAROUND_MARKER))) && !Boolean.parseBoolean((String) params.get(CFG_WORKAROUND_DONE_MARKER)) ){
                    logger.info("Preparing workaround for oracle-jdk-bug since 1.8.0u40 regarding native linux launcher(s) inside native linux installers.");
                    workarounds.applyWorkaround205(appName, nativeLaunchers, params);
                    params.put(CFG_WORKAROUND_DONE_MARKER, "true");
                }
            } else {
                logger.info("Skipped workaround for native linux launcher(s).");
            }
        }
    }

    if( "jnlp".equals(currentRunningBundlerID) ){
        if( workarounds.isWorkaroundForBug182Needed() ){
            // Workaround for "JNLP-generation: path for dependency-lib on windows with backslash"
            // https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/182
            // jnlp-bundler uses RelativeFileSet, and generates system-dependent dividers (\ on windows, / on others)
            logger.info("Applying workaround for oracle-jdk-bug since 1.8.0u60 regarding jar-path inside generated JNLP-files.");
            if( !ext.isSkipJNLPRessourcePathWorkaround182() ){
                workarounds.fixPathsInsideJNLPFiles();
            } else {
                logger.info("Skipped workaround for jar-paths jar-path inside generated JNLP-files.");
            }
        }

        // Do sign generated jar-files by calling the packager (this might change in the future,
        // hopefully when oracle reworked the process inside the JNLP-bundler)
        // https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/185
        if( workarounds.isWorkaroundForBug185Needed(params) ){
            logger.info("Signing jar-files referenced inside generated JNLP-files.");
            if( !ext.isSkipSigningJarFilesJNLP185() ){
                // JavaFX signing using BLOB method will get dropped on JDK 9: "blob signing is going away in JDK9. "
                // https://bugs.openjdk.java.net/browse/JDK-8088866?focusedCommentId=13889898#comment-13889898
                if( !ext.isNoBlobSigning() ){
                    logger.info("Signing jar-files using BLOB method.");
                    signJarFilesUsingBlobSigning(project, ext);
                } else {
                    logger.info("Signing jar-files using jarsigner.");
                    signJarFiles(project, ext);
                }
                workarounds.applyWorkaround185(ext.isSkipSizeRecalculationForJNLP185());
            } else {
                logger.info("Skipped signing jar-files referenced inside JNLP-files.");
            }
        }
    }
}
 
開發者ID:FibreFoX,項目名稱:javafx-gradle-plugin,代碼行數:64,代碼來源:JfxNativeWorker.java


注:本文中的org.gradle.api.logging.Logger.info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。