Last active
March 2, 2018 20:24
-
-
Save ml10/b5f56d5bf2279cd0b9e5ba7e5b33f5b0 to your computer and use it in GitHub Desktop.
Double Info Logging with Scribe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2018.03.03 14:23:08 [run-main-2] INFO org.ml10.ScribeDoubleInfo:7 - info | |
2018.03.03 14:23:08 [run-main-2] INFO org.ml10.ScribeDoubleInfo:9 - info | |
2018.03.03 14:23:08 [run-main-2] INFO org.ml10.ScribeDoubleInfo:12 - info | |
2018.03.03 14:23:08 [run-main-2] INFO org.ml10.ScribeDoubleInfo:12 - info | |
2018.03.03 14:23:08 [run-main-2] DEBUG org.ml10.ScribeDoubleInfo:13 - debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ml10 | |
import scribe._ | |
object ScribeDoubleInfo extends App { | |
debug("debug") | |
info("info") | |
configureLogging("org.ml10.ScribeDoubleInfo", false) | |
info("info") | |
debug("debug") | |
configureLogging("org.ml10.ScribeDoubleInfo", true) | |
info("info") | |
debug("debug") | |
def configureLogging(debugPath: String, combined: Boolean): Unit = { | |
if (combined) { | |
Logger.update(debugPath)(_.clearHandlers().withHandler(minimumLevel = Level.Debug)) | |
} else { | |
val logger = Logger.byName(debugPath) | |
logger.clearHandlers() | |
logger.withHandler(minimumLevel = Level.Debug) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment