Skip to content

Commit 4e18af0

Browse files
committed
[repl] Add debugLog function to enable debug log output
1 parent 9f88e47 commit 4e18af0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

minidns-repl/scala.repl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ import org.minidns.jul.MiniDnsJul._
1616

1717
import java.net.InetAddress
1818

19+
import java.util.logging._
20+
21+
def debugLog() = {
22+
val miniDnsLogger = Logger.getLogger("org.minidns")
23+
miniDnsLogger.setLevel(Level.FINE)
24+
val consoleHandler = new ConsoleHandler()
25+
consoleHandler.setLevel(Level.FINE)
26+
miniDnsLogger.addHandler(consoleHandler)
27+
}
28+
1929
// Some standard values
2030
Predef.println("Set value 'c' to DNSClient")
2131
val c = org.minidns.minidnsrepl.MiniDnsRepl.DNSCLIENT
@@ -33,4 +43,5 @@ val dr = org.minidns.hla.DnssecResolverApi.INSTANCE
3343
Predef.println("Enjoy MiniDNS. Go ahead and try a query. For example:")
3444
Predef.println("c query (\"geekplace.eu\", TYPE.A)")
3545
Predef.println("dr resolveDnssecReliable (\"verteiltesysteme.net\", classOf[A])")
46+
Predef.println("NOTE: You can enable debug log output by calling 'debugLog'")
3647

0 commit comments

Comments
 (0)