aboutsummaryrefslogtreecommitdiff
path: root/javadoc/src
diff options
context:
space:
mode:
authorSergey Mashkov <sergey.mashkov@jetbrains.com>2015-08-06 11:33:53 +0300
committerSergey Mashkov <sergey.mashkov@jetbrains.com>2015-08-06 11:33:53 +0300
commit6012a2842da93a03c72e6ef6ccc4ed5097801610 (patch)
treef2571181a0c30ca07f16c0e321eedbe7d11daa60 /javadoc/src
parent3097aaae486b952c9a4ca570c6189ce1147aec67 (diff)
downloaddokka-6012a2842da93a03c72e6ef6ccc4ed5097801610.tar.gz
dokka-6012a2842da93a03c72e6ef6ccc4ed5097801610.tar.bz2
dokka-6012a2842da93a03c72e6ef6ccc4ed5097801610.zip
~ use dokka logger
Diffstat (limited to 'javadoc/src')
-rw-r--r--javadoc/src/main/kotlin/dokka-adapters.kt2
-rw-r--r--javadoc/src/main/kotlin/reporter.kt18
2 files changed, 12 insertions, 8 deletions
diff --git a/javadoc/src/main/kotlin/dokka-adapters.kt b/javadoc/src/main/kotlin/dokka-adapters.kt
index c9183d50..0f7c53d7 100644
--- a/javadoc/src/main/kotlin/dokka-adapters.kt
+++ b/javadoc/src/main/kotlin/dokka-adapters.kt
@@ -9,7 +9,7 @@ class JavadocGenerator(val conf: DokkaGenerator) : Generator {
val module = nodes.single() as DocumentationModule
DokkaConsoleLogger.report()
- HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter, conf.outputDir))
+ HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter(conf.logger), conf.outputDir))
}
override fun buildOutlines(nodes: Iterable<DocumentationNode>) {
diff --git a/javadoc/src/main/kotlin/reporter.kt b/javadoc/src/main/kotlin/reporter.kt
index ce80ec7b..fc38368c 100644
--- a/javadoc/src/main/kotlin/reporter.kt
+++ b/javadoc/src/main/kotlin/reporter.kt
@@ -2,29 +2,33 @@ package org.jetbrains.dokka.javadoc
import com.sun.javadoc.DocErrorReporter
import com.sun.javadoc.SourcePosition
+import org.jetbrains.dokka.DokkaLogger
-object StandardReporter : DocErrorReporter {
+class StandardReporter(val logger: DokkaLogger) : DocErrorReporter {
override fun printWarning(msg: String?) {
- System.err?.println("[WARN] $msg")
+ logger.warn(msg.toString())
}
override fun printWarning(pos: SourcePosition?, msg: String?) {
- System.err?.println("[WARN] ${pos?.file()}:${pos?.line()}:${pos?.column()}: $msg")
+ logger.warn(format(pos, msg))
}
override fun printError(msg: String?) {
- System.err?.println("[ERROR] $msg")
+ logger.error(msg.toString())
}
override fun printError(pos: SourcePosition?, msg: String?) {
- System.err?.println("[ERROR] ${pos?.file()}:${pos?.line()}:${pos?.column()}: $msg")
+ logger.error(format(pos, msg))
}
override fun printNotice(msg: String?) {
- System.err?.println("[NOTICE] $msg")
+ logger.info(msg.toString())
}
override fun printNotice(pos: SourcePosition?, msg: String?) {
- System.err?.println("[NOTICE] ${pos?.file()}:${pos?.line()}:${pos?.column()}: $msg")
+ logger.info(format(pos, msg))
}
+
+ private fun format(pos: SourcePosition?, msg: String?) =
+ if (pos == null) msg.toString() else "${pos.file()}:${pos.line()}:${pos.column()}: $msg"
} \ No newline at end of file