aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc8/src/main/kotlin/javadoc/reporter.kt
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-09-10 15:15:09 +0200
committerKamil Doległo <kamilok1965@interia.pl>2019-10-10 12:21:16 +0200
commitb536699655e40c62cd603e1f98869786566604bd (patch)
treec99447d71551ef9338bef1913d86062c22224e32 /plugins/javadoc8/src/main/kotlin/javadoc/reporter.kt
parentde2f32d91fb6f564826ddd7644940452356e2080 (diff)
downloaddokka-b536699655e40c62cd603e1f98869786566604bd.tar.gz
dokka-b536699655e40c62cd603e1f98869786566604bd.tar.bz2
dokka-b536699655e40c62cd603e1f98869786566604bd.zip
WIP on restructuring
Diffstat (limited to 'plugins/javadoc8/src/main/kotlin/javadoc/reporter.kt')
-rw-r--r--plugins/javadoc8/src/main/kotlin/javadoc/reporter.kt34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/javadoc8/src/main/kotlin/javadoc/reporter.kt b/plugins/javadoc8/src/main/kotlin/javadoc/reporter.kt
new file mode 100644
index 00000000..fc38368c
--- /dev/null
+++ b/plugins/javadoc8/src/main/kotlin/javadoc/reporter.kt
@@ -0,0 +1,34 @@
+package org.jetbrains.dokka.javadoc
+
+import com.sun.javadoc.DocErrorReporter
+import com.sun.javadoc.SourcePosition
+import org.jetbrains.dokka.DokkaLogger
+
+class StandardReporter(val logger: DokkaLogger) : DocErrorReporter {
+ override fun printWarning(msg: String?) {
+ logger.warn(msg.toString())
+ }
+
+ override fun printWarning(pos: SourcePosition?, msg: String?) {
+ logger.warn(format(pos, msg))
+ }
+
+ override fun printError(msg: String?) {
+ logger.error(msg.toString())
+ }
+
+ override fun printError(pos: SourcePosition?, msg: String?) {
+ logger.error(format(pos, msg))
+ }
+
+ override fun printNotice(msg: String?) {
+ logger.info(msg.toString())
+ }
+
+ override fun printNotice(pos: SourcePosition?, msg: String?) {
+ 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