• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.jetbrains.dokka
2 
3 interface DokkaLogger {
infonull4     fun info(message: String)
5     fun warn(message: String)
6     fun error(message: String)
7 }
8 
9 object DokkaConsoleLogger : DokkaLogger {
10     var warningCount: Int = 0
11 
12     override fun info(message: String) = println(message)
13     override fun warn(message: String) {
14         println("WARN: $message")
15         warningCount++
16     }
17 
18     override fun error(message: String) = println("ERROR: $message")
19 
20     fun report() {
21         if (warningCount > 0) {
22             println("generation completed with $warningCount warnings")
23         } else {
24             println("generation completed successfully")
25         }
26     }
27 }
28