当前位置: 首页>>代码示例>>Java>>正文


Java ConsoleLogger类代码示例

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


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

示例1: RepoIndexer

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
public RepoIndexer(StoringRepo repo) {
    if (repo == null) {
        throw new IllegalArgumentException("Repo cannot be null");
    }
    this.repo = repo;
    //Unplexus
    defaultIndexerEngine = new DefaultIndexerEngine();
    FieldUtils.setProtectedFieldValue("indexerEngine", this, defaultIndexerEngine);
    DefaultQueryCreator queryCreator = new DefaultQueryCreator();
    FieldUtils.setProtectedFieldValue("logger", queryCreator,
            new ConsoleLogger(org.codehaus.plexus.logging.Logger.LEVEL_INFO, "console"));
    FieldUtils.setProtectedFieldValue("queryCreator", this, queryCreator);
    FieldUtils.setProtectedFieldValue("searcher", this, new DefaultSearchEngine());
    //packer
    IncrementalHandler incrementalHandler = new DefaultIncrementalHandler();
    FieldUtils.setProtectedFieldValue("logger", incrementalHandler,
            new ConsoleLogger(org.codehaus.plexus.logging.Logger.LEVEL_INFO, "console"));
    packer = new DefaultIndexPacker();
    FieldUtils.setProtectedFieldValue("incrementalHandler", packer, incrementalHandler);
    FieldUtils.setProtectedFieldValue("logger", packer,
            new ConsoleLogger(org.codehaus.plexus.logging.Logger.LEVEL_WARN, "console"));

    ArtifactoryArtifactContextProducer artifactContextProducer = new ArtifactoryArtifactContextProducer();
    scanner = new ArtifactoryContentScanner(artifactContextProducer);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:26,代码来源:RepoIndexer.java

示例2: testPostsShutdownToServer

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
@Test
public void testPostsShutdownToServer() throws Exception {
    server.enqueue(new MockResponse());
    server.play();

    final BasicBrooklynForker forker = new BasicBrooklynForker();
    forker.setLogger(new ConsoleLogger());
    StopBrooklynMojo mojo = new StopBrooklynMojo(server.getUrl("/"));
    mojo.setForker(forker);
    mojo.setPollPeriod(1, TimeUnit.MILLISECONDS);
    // Test ignoreSkipTests at the same time.
    mojo.setIgnoreSkipTests();
    mojo.setSkipTests();
    executeMojoWithTimeout(mojo);

    RecordedRequest r = server.takeRequest(1, TimeUnit.MILLISECONDS);
    assertEquals("/v1/server/shutdown", r.getPath());
    assertEquals("POST", r.getMethod());
}
 
开发者ID:brooklyncentral,项目名称:brooklyn-maven-plugin,代码行数:20,代码来源:StopBrooklynMojoTest.java

示例3: tar

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
private static File tar(Set<File> files, String folder) throws IOException {
    TarArchiver tarArchive = new TarArchiver();
    tarArchive.enableLogging(new ConsoleLogger(Logger.LEVEL_DISABLED, "console"));
    for (File file : files) {
        // The starting ./ in the folder name is required for Heroku to be able to unpack the files correctly.
        if (file.isFile()) {
            tarArchive.addFile(file, "./" + folder + "/" + file.getName());
        } else if (file.isDirectory()) {
            tarArchive.addDirectory(file, "./" + folder + "/" + file.getName() + "/");
        }
    }

    File tarFile = File.createTempFile("TarGzArchive", ".tar");
    tarArchive.setDestFile(tarFile);
    tarArchive.createArchive();

    return tarFile;
}
 
开发者ID:Lugribossk,项目名称:dropwizard-experiment,代码行数:19,代码来源:TarGzArchive.java

示例4: newShader

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
private static DefaultShader newShader()
{
    DefaultShader s = new DefaultShader();

    s.enableLogging( new ConsoleLogger( Logger.LEVEL_INFO, "TEST" ) );

    return s;
}
 
开发者ID:javiersigler,项目名称:apache-maven-shade-plugin,代码行数:9,代码来源:DefaultShaderTest.java

示例5: testReadingPom

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
@Test
public void testReadingPom() {
    DefaultArtifactFreezeMapping mapping = new DefaultArtifactFreezeMapping(
            SamplePom_ArtifactInheritsVersion.fakedStamper(),
            new ConsoleLogger());

    mapping.put(SamplePom_ArtifactInheritsVersion.asStream());
    Assert.assertTrue(mapping.contains(SamplePom_ArtifactInheritsVersion.groupIdArtifactIdVersion()));
    Assert.assertEquals(SamplePom_ArtifactInheritsVersion.frozenGroupIdArtifactIdVersion(), mapping.getFrozenArtifact(SamplePom_ArtifactInheritsVersion.groupIdArtifactIdVersion()));
}
 
开发者ID:rvs-fluid-it,项目名称:mvn-fluid-cd,代码行数:11,代码来源:DefaultArtifactFreezeMappingTest.java

示例6: initializeResolver

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
@Before
public void initializeResolver() {
    this.resolver = new LocalRepositoryFrozenArtficactResolver(
            new ConsoleLogger(),
            new LocalRepositoryDirectorySpy() {
                @Override
                public File localRepositoryDirectory() {
                    return new File("src/test/repo");
                }
            },
            new DefaultArtifactFreezeMapping(null, new ConsoleLogger()),
            new StamperSwitch(RevisionBuildNumberStamper.HINT,new RevisionBuildNumberStamper(new ConsoleLogger()), new ConsoleLogger())
    );
}
 
开发者ID:rvs-fluid-it,项目名称:mvn-fluid-cd,代码行数:15,代码来源:LocalRepositoryFrozenArtficactResolverTest.java

示例7: freezePom_ArtifactInheritsVersion

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
@Test
public void freezePom_ArtifactInheritsVersion() {
    FrozenArtifactResolver frozenArtifactResolverDummy = new FrozenArtifactResolver() {
        @Override
        public GroupIdArtifactIdVersion getLatestFrozenVersion(GroupIdArtifactIdVersion snapshotGroupIdArtifactIdVersion) {
            if (SamplePom_ArtifactInheritsVersion.parentGroupIdArtifactIdVersion().equals(snapshotGroupIdArtifactIdVersion)) {
                return SamplePom_ArtifactInheritsVersion.frozenParentGroupIdArtifactIdVersion();
            } else if (SamplePom_ArtifactInheritsVersion.libraryGroupIdArtifactIdVersion().equals(snapshotGroupIdArtifactIdVersion)) {
                return SamplePom_ArtifactInheritsVersion.frozenLibraryGroupIdArtifactIdVersion();
            }
            throw new IllegalStateException("Not expected groupIdArtifactIdVersionPrefix : " + snapshotGroupIdArtifactIdVersion);
        }

        @Override
        public boolean artifactInheritsVersionFromParent() {
            return true;
        }

        @Override
        public String artifactFrozenVersion() {
            return SamplePom_ArtifactInheritsVersion.FROZEN_VERSION;
        }
    };

    ByteArrayOutputStream pomOutputStream = new ByteArrayOutputStream();
    new DefaultPomFreezer(frozenArtifactResolverDummy, SamplePom_ArtifactInheritsVersion.fakedStamper(), new ConsoleLogger()).freeze(SamplePom_ArtifactInheritsVersion.asStream(), pomOutputStream);
    String pomContent = pomOutputStream.toString();
    System.out.print(pomContent);
    Assert.assertTrue(pomContent.contains("<version>" + SamplePom_ArtifactInheritsVersion.FROZEN_VERSION + "</version>"));
    Assert.assertTrue(pomContent.contains("<version>" + SamplePom_ArtifactInheritsVersion.LIBRARY_FROZEN_VERSION + "</version>"));
}
 
开发者ID:rvs-fluid-it,项目名称:mvn-fluid-cd,代码行数:32,代码来源:PomFreezerTest.java

示例8: freezePom

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
@Test
public void freezePom() {
    FrozenArtifactResolver frozenArtifactResolverDummy = new FrozenArtifactResolver() {
        @Override
        public GroupIdArtifactIdVersion getLatestFrozenVersion(GroupIdArtifactIdVersion snapshotGroupIdArtifactIdVersion) {
            if (SamplePom_ArtifactInheritsVersion.parentGroupIdArtifactIdVersion().equals(snapshotGroupIdArtifactIdVersion)) {
                return SamplePom_ArtifactInheritsVersion.frozenParentGroupIdArtifactIdVersion();
            } else if (SamplePom_ArtifactInheritsVersion.groupIdArtifactIdVersion().equals(snapshotGroupIdArtifactIdVersion)) {
                return SamplePom_ArtifactInheritsVersion.frozenGroupIdArtifactIdVersion();
            } else if (SamplePom_ArtifactInheritsVersion.libraryGroupIdArtifactIdVersion().equals(snapshotGroupIdArtifactIdVersion)) {
                return SamplePom_ArtifactInheritsVersion.frozenLibraryGroupIdArtifactIdVersion();
            }
            throw new IllegalStateException("Not expected groupIdArtifactIdVersionPrefix : " + snapshotGroupIdArtifactIdVersion);
        }

        @Override
        public boolean artifactInheritsVersionFromParent() {
            return false;
        }

        @Override
        public String artifactFrozenVersion() {
            return SamplePom_ArtifactInheritsVersion.FROZEN_VERSION;
        }
    };

    ByteArrayOutputStream pomOutputStream = new ByteArrayOutputStream();
    new DefaultPomFreezer(frozenArtifactResolverDummy, SamplePom_ArtifactInheritsVersion.fakedStamper(), new ConsoleLogger()).freeze(SamplePom_Library.asStream(), pomOutputStream);
    String pomContent = pomOutputStream.toString();
    System.out.print(pomContent);
    Assert.assertTrue(pomContent.contains("<version>" + SamplePom_ArtifactInheritsVersion.FROZEN_VERSION + "</version>"));
    Assert.assertTrue(pomContent.contains("<version>" + SamplePom_ArtifactInheritsVersion.LIBRARY_FROZEN_VERSION + "</version>"));
}
 
开发者ID:rvs-fluid-it,项目名称:mvn-fluid-cd,代码行数:34,代码来源:PomFreezerTest.java

示例9: testPolishPom

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
@Test
public void testPolishPom() {
    ByteArrayOutputStream pomOutputStream = new ByteArrayOutputStream();
    ConsoleLogger logger = new ConsoleLogger();
    logger.setThreshold(Logger.LEVEL_DEBUG);
    new DefaultPomPolisher(null, logger).polish(SamplePom.asStream(), pomOutputStream);
    String pomContent = pomOutputStream.toString();
    System.out.print(pomContent);
}
 
开发者ID:rvs-fluid-it,项目名称:mvn-fluid-cd,代码行数:10,代码来源:PolishTest.java

示例10: extractApklib

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
public void extractApklib( Artifact apklibArtifact ) throws MojoExecutionException
{
    final File apkLibFile = artifactResolverHelper.resolveArtifactToFile( apklibArtifact );
    if ( apkLibFile.isDirectory() )
    {
        log.warn(
                "The apklib artifact points to '" + apkLibFile + "' which is a directory; skipping unpacking it." );
        return;
    }

    final UnArchiver unArchiver = new ZipUnArchiver ( apkLibFile )
    {
        @Override
        protected Logger getLogger()
        {
            return new ConsoleLogger( log.getThreshold(), "dependencies-unarchiver" );
        }
    };

    final File apklibDirectory = getUnpackedLibFolder( apklibArtifact );
    apklibDirectory.mkdirs();
    unArchiver.setDestDirectory( apklibDirectory );
    log.debug( "Extracting APKLIB to " + apklibDirectory );
    try
    {
        unArchiver.extract();
    }
    catch ( ArchiverException e )
    {
        throw new MojoExecutionException ( "ArchiverException while extracting " + apklibDirectory
                + ". Message: " + e.getLocalizedMessage(), e );
    }
}
 
开发者ID:simpligility,项目名称:android-ndk-maven-plugin,代码行数:34,代码来源:UnpackedLibHelper.java

示例11: install

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
protected boolean install()
		throws IOException {
	URL url = new URL(
			GCLOUD_URL + GCLOUD_TAR);

	final File downloadFile = new File(
			sdkDir,
			GCLOUD_TAR);
	if (!downloadFile.exists()) {
		try (FileOutputStream fos = new FileOutputStream(
				downloadFile)) {
			IOUtils.copyLarge(
					url.openStream(),
					fos);
			fos.flush();
		}
	}

	final TarGZipUnArchiver unarchiver = new TarGZipUnArchiver();
	unarchiver.enableLogging(new ConsoleLogger(
			Logger.LEVEL_WARN,
			"Gcloud SDK Unarchive"));
	unarchiver.setSourceFile(downloadFile);
	unarchiver.setDestDirectory(sdkDir);
	unarchiver.extract();

	if (!downloadFile.delete()) {
		LOGGER.warn("cannot delete " + downloadFile.getAbsolutePath());
	}

	// Check the install
	if (!isInstalled()) {
		LOGGER.error("Gcloud install failed");
		return false;
	}

	// Install the beta components
	CommandLine cmdLine = new CommandLine(
			sdkDir + "/" + GCLOUD_EXE);
	cmdLine.addArgument("components");
	cmdLine.addArgument("install");
	cmdLine.addArgument("beta");
	cmdLine.addArgument("--quiet");
	DefaultExecutor executor = new DefaultExecutor();
	int exitValue = executor.execute(cmdLine);

	LOGGER.warn("KAM >>> gcloud install beta; exit code = " + exitValue);

	return (exitValue == 0);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:51,代码来源:BigtableEmulator.java

示例12: init

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
/**
 * Initialize logging.
 * @throws Exception If something wrong inside
 */
@BeforeClass
public static void init() throws Exception {
    StaticLoggerBinder.getSingleton().setMavenLog(
        new DefaultLog(
            new ConsoleLogger(
                Logger.LEVEL_DEBUG,
                StaticLoggerBinderTest.class.getName()
            )
        )
    );
}
 
开发者ID:jcabi,项目名称:jcabi-maven-slf4j,代码行数:16,代码来源:StaticLoggerBinderTest.java

示例13: init

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
/**
 * Initialize loggers.
 * @throws Exception If something wrong inside
 */
@BeforeClass
public static void init() throws Exception {
    StaticLoggerBinder.getSingleton().setMavenLog(
        new DefaultLog(
            new ConsoleLogger(
                Logger.LEVEL_DEBUG,
                JcabiLoggersTest.class.getName()
            )
        )
    );
}
 
开发者ID:jcabi,项目名称:jcabi-maven-slf4j,代码行数:16,代码来源:JcabiLoggersTest.java

示例14: setUp

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
@Override
protected void setUp()
    throws Exception
{
    super.setUp();

    updateCheckManager = new DefaultUpdateCheckManager( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:DefaultUpdateCheckManagerTest.java

示例15: unpack

import org.codehaus.plexus.logging.console.ConsoleLogger; //导入依赖的package包/类
/**
 * Unpack a .tar.gz archive and return the folder it was unpacked in.
 *
 * @param tarGz The archive
 * @return The unpacked folder
 */
public static File unpack(File tarGz) {
    File unpackDir = Files.createTempDir();
    unpackDir.deleteOnExit();

    TarGZipUnArchiver unArchiver = new TarGZipUnArchiver(tarGz);
    // Needed to avoid a null pointer...
    unArchiver.enableLogging(new ConsoleLogger(Logger.LEVEL_DISABLED, "console"));
    unArchiver.setDestDirectory(unpackDir);
    unArchiver.extract();

    return unpackDir;
}
 
开发者ID:Lugribossk,项目名称:dropwizard-experiment,代码行数:19,代码来源:TarGzArchive.java


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