本文整理汇总了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);
}
示例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());
}
示例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;
}
示例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;
}
示例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()));
}
示例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())
);
}
示例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>"));
}
示例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>"));
}
示例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);
}
示例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 );
}
}
示例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);
}
示例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()
)
)
);
}
示例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()
)
)
);
}
示例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" ) );
}
示例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;
}