-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make logging more extensible and improve speed
- Loading branch information
1 parent
8689968
commit e63373e
Showing
6 changed files
with
158 additions
and
98 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
lib/src/main/kotlin/org/cosmic/ide/dependency/resolver/api/EventReciever.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package org.cosmic.ide.dependency.resolver.api | ||
|
||
import java.util.logging.Logger | ||
|
||
open class EventReciever { | ||
|
||
val logger: Logger = Logger.getLogger("DependencyResolver") | ||
|
||
open fun onArtifactFound(artifact: Artifact) { | ||
logger.info("Found ${artifact.groupId}:${artifact.artifactId}:${artifact.version} in ${artifact.repository?.getName()}") | ||
} | ||
|
||
open fun onArtifactNotFound(artifact: Artifact) { | ||
logger.info("No repository contains ${artifact.artifactId}:${artifact.version}") | ||
} | ||
|
||
open fun onFetchingLatestVersion(artifact: Artifact) { | ||
logger.info("Fetching latest version of ${artifact.artifactId}") | ||
} | ||
|
||
open fun onFetchedLatestVersion(artifact: Artifact, version: String) { | ||
logger.info("Fetched latest version of ${artifact.artifactId}: $version") | ||
} | ||
|
||
open fun onResolving(artifact: Artifact, dependency: Artifact) { | ||
logger.info("Resolving $dependency from $artifact") | ||
} | ||
|
||
open fun onResolutionComplete(artifact: Artifact) { | ||
logger.info("Resolution complete for ${artifact.artifactId}") | ||
} | ||
|
||
open fun onSkippingResolution(artifact: Artifact) { | ||
logger.info("Skipping resolution of $artifact as it is already resolved") | ||
} | ||
|
||
open fun onVersionNotFound(artifact: Artifact) { | ||
logger.info("Version not found for ${artifact.artifactId}") | ||
} | ||
|
||
open fun onDependenciesNotFound(artifact: Artifact) { | ||
logger.info("No dependencies found for ${artifact.artifactId}") | ||
} | ||
|
||
open fun onInvalidScope(artifact: Artifact, scope: String) { | ||
logger.info("Invalid scope $scope for ${artifact.artifactId}") | ||
} | ||
|
||
open fun onInvalidPOM(artifact: Artifact) { | ||
logger.info("Invalid POM for ${artifact.artifactId}") | ||
} | ||
|
||
open fun onDownloadStart(artifact: Artifact) { | ||
logger.info("Starting download of ${artifact.artifactId}:${artifact.version}") | ||
} | ||
|
||
open fun onDownloadEnd(artifact: Artifact) { | ||
logger.info("Download complete for ${artifact.artifactId}:${artifact.version}") | ||
} | ||
|
||
open fun onDownloadError(artifact: Artifact, error: Throwable) { | ||
logger.severe("Error downloading ${artifact.artifactId}:${artifact.version}: ${error.message}") | ||
} | ||
} |
Oops, something went wrong.