diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 77269ef820..684200aa82 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -15,5 +15,8 @@ + + + \ No newline at end of file diff --git a/dokka-integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt b/dokka-integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt index b9c29dc57b..8c41fbcb62 100644 --- a/dokka-integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt +++ b/dokka-integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt @@ -38,6 +38,7 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { "-outputDir", dokkaOutputDir.path, "-pluginsClasspath", basePluginJarFile.path, "-moduleName", "Basic Project", + "-loggingLevel", "DEBUG", "-sourceSet", buildString { append(" -sourceSetName cliMain") @@ -279,7 +280,7 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { } val process = ProcessBuilder( - "java", "-jar", cliJarFile.path, jsonPath + "java", "-jar", cliJarFile.path, jsonPath, "-loggingLevel", "DEBUG" ).redirectErrorStream(true).start() val result = process.awaitProcessResult() @@ -351,7 +352,7 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { } val process = ProcessBuilder( - "java", "-jar", cliJarFile.path, jsonPath + "java", "-jar", cliJarFile.path, jsonPath, "-loggingLevel", "DEBUG" ).redirectErrorStream(true).start() val result = process.awaitProcessResult() diff --git a/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/BiojavaIntegrationTest.kt b/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/BiojavaIntegrationTest.kt index cb1cd0f2e0..eef2778e7b 100644 --- a/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/BiojavaIntegrationTest.kt +++ b/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/BiojavaIntegrationTest.kt @@ -31,7 +31,7 @@ class BiojavaIntegrationTest : AbstractIntegrationTest(), TestOutputCopier { @Test fun `dokka javadoc`() { val result = ProcessBuilder().directory(projectDir) - .command(mavenBinaryFile.absolutePath, "dokka:javadoc", "-pl", "biojava-core", "\"-Ddokka_version=$currentDokkaVersion\"", "-U", "-e").start().awaitProcessResult() + .command(mavenBinaryFile.absolutePath, "dokka:javadoc", "-pl", "biojava-core", "\"-Ddokka_version=$currentDokkaVersion\"", "-X", "-U", "-e").start().awaitProcessResult() diagnosticAsserts(result) diff --git a/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt b/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt index 2bc3a61c90..4eccd6b761 100644 --- a/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt +++ b/dokka-integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt @@ -57,7 +57,7 @@ class MavenIntegrationTest : AbstractIntegrationTest() { @Test fun `dokka dokka`() { val result = ProcessBuilder().directory(projectDir) - .command(mavenBinaryFile.absolutePath, "dokka:dokka", "-U", "-e").start().awaitProcessResult() + .command(mavenBinaryFile.absolutePath, "dokka:dokka", "-X", "-U", "-e").start().awaitProcessResult() diagnosticAsserts(result) @@ -106,7 +106,7 @@ class MavenIntegrationTest : AbstractIntegrationTest() { @Test fun `dokka javadoc`() { val result = ProcessBuilder().directory(projectDir) - .command(mavenBinaryFile.absolutePath, "dokka:javadoc", "-U", "-e").start().awaitProcessResult() + .command(mavenBinaryFile.absolutePath, "dokka:javadoc", "-X", "-U", "-e").start().awaitProcessResult() diagnosticAsserts(result) @@ -128,7 +128,7 @@ class MavenIntegrationTest : AbstractIntegrationTest() { @Test fun `dokka javadocJar`() { val result = ProcessBuilder().directory(projectDir) - .command(mavenBinaryFile.absolutePath, "dokka:javadocJar", "-U", "-e").start().awaitProcessResult() + .command(mavenBinaryFile.absolutePath, "dokka:javadocJar", "-X", "-U", "-e").start().awaitProcessResult() diagnosticAsserts(result) diff --git a/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/doccomment/DocCommentFinder.kt b/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/doccomment/DocCommentFinder.kt index d16c0c2827..0701ded7fa 100644 --- a/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/doccomment/DocCommentFinder.kt +++ b/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/doccomment/DocCommentFinder.kt @@ -47,7 +47,7 @@ public class DocCommentFinder( return superMethodDocumentation.single() } - logger.debug( + logger.warn( "Conflicting documentation for ${DRI.from(method)}" + "${superMethods.map { DRI.from(it) }}" ) diff --git a/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt b/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt index 9ddb47f16b..48fb1f6b1e 100644 --- a/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt +++ b/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt @@ -87,7 +87,7 @@ internal class DokkaMessageCollector(private val logger: DokkaLogger) : MessageC if (severity == CompilerMessageSeverity.ERROR) { seenErrors = true } - logger.info(MessageRenderer.PLAIN_FULL_PATHS.render(severity, message, location)) + logger.debug(MessageRenderer.PLAIN_FULL_PATHS.render(severity, message, location)) } override fun hasErrors() = seenErrors diff --git a/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorSampleAnalysisEnvironment.kt b/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorSampleAnalysisEnvironment.kt index c1561e4b48..144632c8c1 100644 --- a/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorSampleAnalysisEnvironment.kt +++ b/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorSampleAnalysisEnvironment.kt @@ -73,7 +73,7 @@ internal class DescriptorSampleAnalysisEnvironment( val samplePsiElement = resolveSession.resolveSamplePsiElement(sourceSet, fullyQualifiedLink) if (samplePsiElement == null) { - dokkaLogger.debug("Cannot resolve sample element for: \"$fullyQualifiedLink\"") + dokkaLogger.warn("Cannot resolve sample element for: \"$fullyQualifiedLink\"") return null } else if (samplePsiElement.containingFile !is KtFile) { dokkaLogger.warn("Unable to resolve non-Kotlin @sample links: \"$fullyQualifiedLink\"") @@ -92,7 +92,7 @@ internal class DescriptorSampleAnalysisEnvironment( ): PsiElement? { val packageDescriptor = resolveNearestPackageDescriptor(fqLink) if (packageDescriptor == null) { - dokkaLogger.debug( + dokkaLogger.warn( "Unable to resolve package descriptor for @sample: \"$fqLink\";" ) return null @@ -154,7 +154,7 @@ internal class DescriptorSampleAnalysisEnvironment( if (packageDescriptor != null) { return packageDescriptor } - dokkaLogger.debug("Failed to resolve package \"$supposedPackageName\" for sample \"$fqLink\"") + dokkaLogger.warn("Failed to resolve package \"$supposedPackageName\" for sample \"$fqLink\"") if (isRootPackage) { // cannot go any deeper diff --git a/dokka-subprojects/analysis-kotlin-symbols/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis.kt b/dokka-subprojects/analysis-kotlin-symbols/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis.kt index 89f6aaca21..a42043716e 100644 --- a/dokka-subprojects/analysis-kotlin-symbols/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis.kt +++ b/dokka-subprojects/analysis-kotlin-symbols/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis.kt @@ -164,7 +164,7 @@ internal fun topologicalSortByDependantSourceSets( souceSet.dependentSourceSets.mapNotNull { dependentSourceSetId -> sourceSets.find { it.sourceSetID == dependentSourceSetId } // just skip - ?: null.also { logger.error("Unknown source set Id $dependentSourceSetId in dependencies of ${souceSet.sourceSetID}") } + ?: null.also { logger.warn("Unknown source set Id $dependentSourceSetId in dependencies of ${souceSet.sourceSetID}") } } verticesAssociatedWithState[souceSet] = State.VISITING dependentSourceSets.forEach(::dfs) diff --git a/dokka-subprojects/core/api/dokka-core.api b/dokka-subprojects/core/api/dokka-core.api index d286915f4a..2c4ac4c727 100644 --- a/dokka-subprojects/core/api/dokka-core.api +++ b/dokka-subprojects/core/api/dokka-core.api @@ -446,7 +446,7 @@ public final class org/jetbrains/dokka/SourceLinkDefinitionImpl$Companion { public final class org/jetbrains/dokka/Timer { public final fun dump (Ljava/lang/String;)V public static synthetic fun dump$default (Lorg/jetbrains/dokka/Timer;Ljava/lang/String;ILjava/lang/Object;)V - public final fun report (Ljava/lang/String;)V + public final fun report (Ljava/lang/String;Lorg/jetbrains/dokka/utilities/LoggingLevel;)V } public abstract interface class org/jetbrains/dokka/generation/Generation { diff --git a/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/DokkaGenerator.kt b/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/DokkaGenerator.kt index 48d90e587d..f2689dfedb 100644 --- a/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/DokkaGenerator.kt +++ b/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/DokkaGenerator.kt @@ -12,6 +12,7 @@ import org.jetbrains.dokka.generation.GracefulGenerationExit import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaLogger +import org.jetbrains.dokka.utilities.LoggingLevel /** * DokkaGenerator is the main entry point for generating documentation @@ -25,12 +26,12 @@ public class DokkaGenerator( public fun generate() { timed(logger) { - report("Initializing plugins") + report("Initializing plugins", LoggingLevel.DEBUG) val context = initializePlugins(configuration, logger) runCatching { context.single(CoreExtensions.generation).run { - logger.progress("Dokka is performing: $generationName") + logger.debug("Dokka is performing: $generationName") generate() } }.exceptionOrNull()?.let { e -> @@ -59,18 +60,29 @@ public class DokkaGenerator( public class Timer internal constructor(startTime: Long, private val logger: DokkaLogger?) { private val steps = mutableListOf("" to startTime) - public fun report(name: String) { - logger?.progress(name) +// public fun report(name: String) { +// logger?.progress(name) +// steps += (name to System.currentTimeMillis()) +// } + + public fun report(name: String, logLevel: LoggingLevel) { + when(logLevel) { + LoggingLevel.DEBUG -> logger?.debug(name) + LoggingLevel.PROGRESS -> logger?.progress(name) + LoggingLevel.INFO -> logger?.info(name) + LoggingLevel.WARN -> logger?.warn(name) + LoggingLevel.ERROR -> logger?.error(name) + } steps += (name to System.currentTimeMillis()) } public fun dump(prefix: String = "") { - logger?.info(prefix) + logger?.debug(prefix) val namePad = steps.map { it.first.length }.maxOrNull() ?: 0 val timePad = steps.windowed(2).map { (p1, p2) -> p2.second - p1.second }.maxOrNull()?.toString()?.length ?: 0 steps.windowed(2).forEach { (p1, p2) -> if (p1.first.isNotBlank()) { - logger?.info("${p1.first.padStart(namePad)}: ${(p2.second - p1.second).toString().padStart(timePad)}") + logger?.debug("${p1.first.padStart(namePad)}: ${(p2.second - p1.second).toString().padStart(timePad)}") } } } @@ -81,9 +93,9 @@ private fun timed(logger: DokkaLogger? = null, block: Timer.() -> Unit): Timer = try { block() } catch (exit: GracefulGenerationExit) { - report("Exiting Generation: ${exit.reason}") + report("Exiting Generation: ${exit.reason}", LoggingLevel.PROGRESS) } finally { - report("") + report("", LoggingLevel.PROGRESS) } } diff --git a/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/plugability/DokkaContext.kt b/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/plugability/DokkaContext.kt index 91418bdaaf..2d389b5a48 100644 --- a/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/plugability/DokkaContext.kt +++ b/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/plugability/DokkaContext.kt @@ -217,9 +217,9 @@ private class DokkaContextConfigurationImpl( "\t${it.key} by " + (it.value.singleOrNull() ?: it.value) } - logger.info("Loaded plugins: $pluginNames") - logger.info("Loaded: $loadedListForDebug") - logger.info("Suppressed: $suppressedList") + logger.debug("Loaded plugins: $pluginNames") + logger.debug("Loaded: $loadedListForDebug") + logger.debug("Suppressed: $suppressedList") } } diff --git a/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/utilities/DokkaLogging.kt b/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/utilities/DokkaLogging.kt index fe04c836b2..a5cb4e284d 100644 --- a/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/utilities/DokkaLogging.kt +++ b/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/utilities/DokkaLogging.kt @@ -108,14 +108,14 @@ public interface DokkaLogger { public fun DokkaLogger.report() { if (warningsCount > 0 || errorsCount > 0) { - info( + progress( "Generation completed with $warningsCount warning" + (if (warningsCount == 1) "" else "s") + " and $errorsCount error" + if (errorsCount == 1) "" else "s" ) } else { - info("Generation completed successfully") + progress("Generation completed successfully") } } diff --git a/dokka-subprojects/plugin-all-modules-page/src/main/kotlin/org/jetbrains/dokka/allModulesPage/AllModulesPageGeneration.kt b/dokka-subprojects/plugin-all-modules-page/src/main/kotlin/org/jetbrains/dokka/allModulesPage/AllModulesPageGeneration.kt index ae2a55c865..76e6662ff5 100644 --- a/dokka-subprojects/plugin-all-modules-page/src/main/kotlin/org/jetbrains/dokka/allModulesPage/AllModulesPageGeneration.kt +++ b/dokka-subprojects/plugin-all-modules-page/src/main/kotlin/org/jetbrains/dokka/allModulesPage/AllModulesPageGeneration.kt @@ -15,6 +15,7 @@ import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.templates.TemplatingPlugin import org.jetbrains.dokka.templates.TemplatingResult import org.jetbrains.dokka.transformers.pages.CreationContext +import org.jetbrains.dokka.utilities.LoggingLevel public class AllModulesPageGeneration(private val context: DokkaContext) : Generation { @@ -22,25 +23,25 @@ public class AllModulesPageGeneration(private val context: DokkaContext) : Gener private val templatingPlugin by lazy { context.plugin() } override fun Timer.generate() { - report("Processing submodules") + report("Processing submodules", LoggingLevel.DEBUG) val generationContext = processSubmodules() - report("Creating all modules page") + report("Creating all modules page", LoggingLevel.DEBUG) val pages = createAllModulesPage(generationContext) - report("Transforming pages") + report("Transforming pages", LoggingLevel.DEBUG) val transformedPages = transformAllModulesPage(pages) - report("Rendering") + report("Rendering", LoggingLevel.DEBUG) render(transformedPages) - report("Processing multimodule") + report("Processing multimodule", LoggingLevel.DEBUG) processMultiModule(transformedPages) - report("Finish submodule processing") + report("Finish submodule processing", LoggingLevel.DEBUG) finishProcessingSubmodules() - report("Running post-actions") + report("Running post-actions", LoggingLevel.DEBUG) runPostActions() } diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/generation/SingleModuleGeneration.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/generation/SingleModuleGeneration.kt index 8193cc7b0c..6693a6846f 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/generation/SingleModuleGeneration.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/generation/SingleModuleGeneration.kt @@ -18,41 +18,42 @@ import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query import org.jetbrains.dokka.transformers.sources.AsyncSourceToDocumentableTranslator +import org.jetbrains.dokka.utilities.LoggingLevel import org.jetbrains.dokka.utilities.parallelMap import org.jetbrains.dokka.utilities.report public class SingleModuleGeneration(private val context: DokkaContext) : Generation { override fun Timer.generate() { - report("Validity check") + report("Validity check", LoggingLevel.DEBUG) validityCheck(context) // Step 1: translate sources into documentables & transform documentables (change internally) - report("Creating documentation models") + report("Creating documentation models", LoggingLevel.DEBUG) val modulesFromPlatforms = createDocumentationModels() - report("Transforming documentation model before merging") + report("Transforming documentation model before merging", LoggingLevel.DEBUG) val transformedDocumentationBeforeMerge = transformDocumentationModelBeforeMerge(modulesFromPlatforms) - report("Merging documentation models") + report("Merging documentation models", LoggingLevel.DEBUG) val transformedDocumentationAfterMerge = mergeDocumentationModels(transformedDocumentationBeforeMerge) ?: exitGenerationGracefully("Nothing to document") - report("Transforming documentation model after merging") + report("Transforming documentation model after merging", LoggingLevel.DEBUG) val transformedDocumentation = transformDocumentationModelAfterMerge(transformedDocumentationAfterMerge) // Step 2: Generate pages & transform them (change internally) - report("Creating pages") + report("Creating pages", LoggingLevel.DEBUG) val pages = createPages(transformedDocumentation) - report("Transforming pages") + report("Transforming pages", LoggingLevel.DEBUG) val transformedPages = transformPages(pages) // Step 3: Rendering - report("Rendering") + report("Rendering", LoggingLevel.DEBUG) render(transformedPages) - report("Running post-actions") + report("Running post-actions", LoggingLevel.DEBUG) runPostActions() reportAfterRendering() @@ -109,7 +110,7 @@ public class SingleModuleGeneration(private val context: DokkaContext) : Generat public fun reportAfterRendering() { context.unusedPoints.takeIf { it.isNotEmpty() }?.also { - context.logger.info("Unused extension points found: ${it.joinToString(", ")}") + context.logger.warn("Unused extension points found: ${it.joinToString(", ")}") } context.logger.report() diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/FileWriter.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/FileWriter.kt index 0fb0c7ac5b..8ec2661596 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/FileWriter.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/FileWriter.kt @@ -39,7 +39,7 @@ public class FileWriter( private suspend fun checkFileCreated(path: String): Boolean = createdFilesMutex.withLock { if (createdFiles.contains(path)) { - context.logger.error("An attempt to write ${root}/$path several times!") + context.logger.warn("An attempt to write ${root}/$path several times!") return true } createdFiles.add(path) diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/PackageListService.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/PackageListService.kt index f1ef01ea87..b347940ae4 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/PackageListService.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/PackageListService.kt @@ -38,7 +38,7 @@ public class PackageListService( val contentPage = node as? ContentPage contentPage?.dri?.forEach { dri -> val nodeLocation = locationProvider.resolve(node, context = module, skipExtension = true) - ?: run { context.logger.error("Cannot resolve path for ${node.name}!"); null } + ?: run { context.logger.warn("Cannot resolve path for ${node.name}!"); null } if (dri != DRI.topLevel && locationProvider.expectedLocationForDri(dri) != nodeLocation) { nonStandardLocations[dri.toString()] = "$nodeLocation.${format.linkExtension}" diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/html/HtmlRenderer.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/html/HtmlRenderer.kt index 760cd786be..5566ce4f4a 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/html/HtmlRenderer.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/html/HtmlRenderer.kt @@ -779,11 +779,11 @@ public open class HtmlRenderer( block: FlowContent.() -> Unit ) { locationProvider.resolve(to, platforms.toSet(), from)?.let { buildLink(it, block) } - ?: run { context.logger.error("Cannot resolve path for `$to` from `$from`"); block() } + ?: run { context.logger.warn("Cannot resolve path for `$to` from `$from`"); block() } } override fun buildError(node: ContentNode) { - context.logger.error("Unknown ContentNode type: $node") + context.logger.warn("Unknown ContentNode type: $node") } override fun FlowContent.buildLineBreak() { diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/resolvers/local/DefaultLocationProvider.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/resolvers/local/DefaultLocationProvider.kt index 397ad22e5c..e564b4abe0 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/resolvers/local/DefaultLocationProvider.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/resolvers/local/DefaultLocationProvider.kt @@ -40,7 +40,7 @@ public abstract class DefaultLocationProvider( externalLocationProviderFactories .mapNotNull { it.getExternalLocationProvider(extDocInfo) } .firstOrNull() - ?: run { dokkaContext.logger.error("No ExternalLocationProvider for '${extDocInfo.packageList.url}' found"); null } + ?: run { dokkaContext.logger.warn("No ExternalLocationProvider for '${extDocInfo.packageList.url}' found"); null } } protected val packagesIndex: Map = diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/DefaultSamplesTransformer.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/DefaultSamplesTransformer.kt index 8eea0f6c6d..6c39dbf8eb 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/DefaultSamplesTransformer.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/DefaultSamplesTransformer.kt @@ -120,7 +120,7 @@ internal class DefaultSamplesTransformer(val context: DokkaContext) : PageTransf is PlatformHintedContent -> copy(inner.dfs(fqName, node)) is ContentText -> if (text == fqName) node else this is ContentBreakLine -> this - else -> this.also { context.logger.error("Could not recognize $this ContentNode in SamplesTransformer") } + else -> this.also { context.logger.warn("Could not recognize $this ContentNode in SamplesTransformer") } } } diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt index 5cd3301154..edeaa7fc3d 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt @@ -29,7 +29,7 @@ public class SameMethodNamePageMergerStrategy( val name = pages.first().name.also { if (pages.any { page -> page.name != it }) { // Is this even possible? - logger.error("Page names for $it do not match!") + logger.warn("Page names for $it do not match!") } } val dri = members.flatMap { it.dri }.toSet() diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/translators/documentables/DefaultPageCreator.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/translators/documentables/DefaultPageCreator.kt index e051c4d556..f60f438e7d 100644 --- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/translators/documentables/DefaultPageCreator.kt +++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/translators/documentables/DefaultPageCreator.kt @@ -104,7 +104,7 @@ public open class DefaultPageCreator( public open fun pageForEnumEntries(documentables: List): ClasslikePageNode { val dri = documentables.dri.also { if (it.size != 1) { - logger.error("Documentable dri should have the same one ${it.first()} inside the one page!") + logger.warn("Documentable dri should have the same one ${it.first()} inside the one page!") } } @@ -132,7 +132,7 @@ public open class DefaultPageCreator( public open fun pageForClasslikes(documentables: List): ClasslikePageNode { val dri = documentables.dri.also { if (it.size != 1) { - logger.error("Documentable dri should have the same one ${it.first()} inside the one page!") + logger.warn("Documentable dri should have the same one ${it.first()} inside the one page!") } } @@ -201,7 +201,7 @@ public open class DefaultPageCreator( public open fun pageForFunctions(fs: List): MemberPageNode { val dri = fs.dri.also { if (it.size != 1) { - logger.error("Function dri should have the same one ${it.first()} inside the one page!") + logger.warn("Function dri should have the same one ${it.first()} inside the one page!") } } return MemberPageNode(fs.first().nameAfterClash(), contentForMembers(fs), dri, fs) @@ -213,7 +213,7 @@ public open class DefaultPageCreator( public open fun pageForProperties(ps: List): MemberPageNode { val dri = ps.dri.also { if (it.size != 1) { - logger.error("Property dri should have the same one ${it.first()} inside the one page!") + logger.warn("Property dri should have the same one ${it.first()} inside the one page!") } } return MemberPageNode(ps.first().nameAfterClash(), contentForMembers(ps), dri, ps) diff --git a/dokka-subprojects/plugin-gfm-template-processing/src/main/kotlin/org/jetbrains/dokka/gfm/templateProcessing/GfmTemplateProcessingStrategy.kt b/dokka-subprojects/plugin-gfm-template-processing/src/main/kotlin/org/jetbrains/dokka/gfm/templateProcessing/GfmTemplateProcessingStrategy.kt index cc6fed928d..43d36d561a 100644 --- a/dokka-subprojects/plugin-gfm-template-processing/src/main/kotlin/org/jetbrains/dokka/gfm/templateProcessing/GfmTemplateProcessingStrategy.kt +++ b/dokka-subprojects/plugin-gfm-template-processing/src/main/kotlin/org/jetbrains/dokka/gfm/templateProcessing/GfmTemplateProcessingStrategy.kt @@ -33,7 +33,7 @@ public class GfmTemplateProcessingStrategy( //This should also work whenever we have a misconfigured dokka and output is pointing to the input //the same way that html processing does if (input.absolutePath == output.absolutePath) { - context.logger.info("Attempting to process GFM templates in place for directory $input, this suggests miss configuration.") + context.logger.warn("Attempting to process GFM templates in place for directory $input, this suggests miss configuration.") val lines = reader.readLines() output.bufferedWriter().use { writer -> lines.forEach { line -> diff --git a/dokka-subprojects/plugin-gfm/src/main/kotlin/org/jetbrains/dokka/gfm/GfmPlugin.kt b/dokka-subprojects/plugin-gfm/src/main/kotlin/org/jetbrains/dokka/gfm/GfmPlugin.kt index c2db1e8d8a..2a2eab517b 100644 --- a/dokka-subprojects/plugin-gfm/src/main/kotlin/org/jetbrains/dokka/gfm/GfmPlugin.kt +++ b/dokka-subprojects/plugin-gfm/src/main/kotlin/org/jetbrains/dokka/gfm/GfmPlugin.kt @@ -49,7 +49,7 @@ public class GfmPlugin : DokkaPlugin() { internal val alphaVersionNotifier by extending { CoreExtensions.postActions providing { ctx -> PostAction { - ctx.logger.info( + ctx.logger.progress( "The GFM output format is still in Alpha so you may find bugs and experience migration " + "issues when using it. You use it at your own risk." ) diff --git a/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt b/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt index b23f094de5..d5a677707c 100644 --- a/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt +++ b/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt @@ -104,7 +104,7 @@ public class JavadocPlugin : DokkaPlugin() { internal val alphaVersionNotifier by extending { CoreExtensions.postActions providing { ctx -> PostAction { - ctx.logger.info( + ctx.logger.progress( "The Javadoc output format is still in Alpha so you may find bugs and experience migration " + "issues when using it. Successful integration with tools that accept Java's Javadoc " + "HTML as input is not guaranteed. You use it at your own risk." diff --git a/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt b/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt index 3fe0ad7d3f..c032fb3b25 100644 --- a/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt +++ b/dokka-subprojects/plugin-javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt @@ -56,7 +56,7 @@ internal class JavadocContentToHtmlTranslator( is ContentResolvedLink -> buildLinkFromNode(node, relative) is ContentCodeBlock -> "
${node.children.joinToString("") { nodeToText(it, insidePre = true) }}
" is ContentCodeInline -> "${node.children.joinToString("") { nodeToText(it) }}" - else -> run { context.logger.error("Cannot cast $node as ContentText!"); "" } + else -> run { context.logger.warn("Cannot cast $node as ContentText!"); "" } } return nodeToText(code) } diff --git a/dokka-subprojects/plugin-jekyll/src/main/kotlin/org/jetbrains/dokka/jekyll/JekyllPlugin.kt b/dokka-subprojects/plugin-jekyll/src/main/kotlin/org/jetbrains/dokka/jekyll/JekyllPlugin.kt index 9b75310ec5..c3b1f0d4cd 100644 --- a/dokka-subprojects/plugin-jekyll/src/main/kotlin/org/jetbrains/dokka/jekyll/JekyllPlugin.kt +++ b/dokka-subprojects/plugin-jekyll/src/main/kotlin/org/jetbrains/dokka/jekyll/JekyllPlugin.kt @@ -55,7 +55,7 @@ public class JekyllPlugin : DokkaPlugin() { internal val alphaVersionNotifier by extending { CoreExtensions.postActions providing { ctx -> PostAction { - ctx.logger.info( + ctx.logger.progress( "The Jekyll output format is still in Alpha so you may find bugs and experience migration " + "issues when using it. You use it at your own risk." ) diff --git a/dokka-subprojects/plugin-kotlin-as-java/src/main/kotlin/org/jetbrains/dokka/kotlinAsJava/KotlinAsJavaPlugin.kt b/dokka-subprojects/plugin-kotlin-as-java/src/main/kotlin/org/jetbrains/dokka/kotlinAsJava/KotlinAsJavaPlugin.kt index ad98deab8f..16f87df200 100644 --- a/dokka-subprojects/plugin-kotlin-as-java/src/main/kotlin/org/jetbrains/dokka/kotlinAsJava/KotlinAsJavaPlugin.kt +++ b/dokka-subprojects/plugin-kotlin-as-java/src/main/kotlin/org/jetbrains/dokka/kotlinAsJava/KotlinAsJavaPlugin.kt @@ -44,7 +44,7 @@ public class KotlinAsJavaPlugin : DokkaPlugin() { internal val alphaVersionNotifier by extending { CoreExtensions.postActions providing { ctx -> PostAction { - ctx.logger.info("KotlinAsJava plugin is in Alpha version, use at your own risk, expect bugs and migration issues") + ctx.logger.progress("KotlinAsJava plugin is in Alpha version, use at your own risk, expect bugs and migration issues") } } } diff --git a/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/allModulesPage/templates/PackageListProcessingStrategy.kt b/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/allModulesPage/templates/PackageListProcessingStrategy.kt index a42ee45177..a49b76cf40 100644 --- a/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/allModulesPage/templates/PackageListProcessingStrategy.kt +++ b/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/allModulesPage/templates/PackageListProcessingStrategy.kt @@ -38,7 +38,7 @@ public class PackageListProcessingStrategy( val linkFormat = fragments.first().linkFormat if (!fragments.all { it.linkFormat == linkFormat }) { - context.logger.error("Link format is inconsistent between modules: " + fragments.joinToString { it.linkFormat.formatName } ) + context.logger.warn("Link format is inconsistent between modules: " + fragments.joinToString { it.linkFormat.formatName } ) } val locations: Map = fragments.map { it.locations }.fold(emptyMap()) { acc, el -> acc + el } diff --git a/dokka-subprojects/plugin-templating/src/test/kotlin/org/jetbrains/dokka/templates/TestTemplatingGeneration.kt b/dokka-subprojects/plugin-templating/src/test/kotlin/org/jetbrains/dokka/templates/TestTemplatingGeneration.kt index 02f5baaaae..1b445cf439 100644 --- a/dokka-subprojects/plugin-templating/src/test/kotlin/org/jetbrains/dokka/templates/TestTemplatingGeneration.kt +++ b/dokka-subprojects/plugin-templating/src/test/kotlin/org/jetbrains/dokka/templates/TestTemplatingGeneration.kt @@ -10,16 +10,17 @@ import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query import org.jetbrains.dokka.plugability.querySingle +import org.jetbrains.dokka.utilities.LoggingLevel class TestTemplatingGeneration(private val context: DokkaContext) : Generation { val templatingPlugin by lazy { context.plugin() } override fun Timer.generate() { - report("Processing submodules") + report("Processing submodules", LoggingLevel.DEBUG) processSubmodules() - report("Finishing processing") + report("Finishing processing", LoggingLevel.PROGRESS) finishProcessing() }