Created
June 24, 2014 10:25
-
-
Save markhibberd/cd5569f8989c912e45d8 to your computer and use it in GitHub Desktop.
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
import org.apache.log4j.ConsoleAppender | |
import org.apache.log4j.PatternLayout | |
import org.apache.log4j.Logger | |
/* These are global for _all_ tests, this isn't optimal, but hadoop. | |
Add Debugger.job or Debugger.detailed to your code to get lots | |
of output. */ | |
object Debugger { | |
def job(): Unit = | |
toConsole(Logger.getLogger("org.apache.hadoop.mapred.LocalJobRunner")) | |
def detailed(): Unit = | |
toConsole(Logger.getRootLogger) | |
def toConsole(logger: Logger): Unit = { | |
val layout = new PatternLayout("%-5p %c %x - %m%n"); | |
logger.addAppender(new ConsoleAppender(layout)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment