@@ -6,15 +6,10 @@ import is.hail.expr.ir.functions.IRFunctionRegistry
66import is .hail .io .fs .FS
77import is .hail .utils ._
88
9- import java .util .Properties
10-
11- import org .apache .log4j .{LogManager , PropertyConfigurator }
129import org .apache .spark ._
1310
1411object HailContext {
1512
16- val logFormat : String = " %d{yyyy-MM-dd HH:mm:ss.SSS} %c{1}: %p: %m%n"
17-
1813 private var theContext : HailContext = _
1914
2015 def get : HailContext = synchronized {
@@ -23,36 +18,6 @@ object HailContext {
2318 theContext
2419 }
2520
26- def configureLogging (logFile : String , quiet : Boolean , append : Boolean ): Unit = {
27- org.apache.log4j.helpers.LogLog .setInternalDebugging(true )
28- org.apache.log4j.helpers.LogLog .setQuietMode(false )
29- val logProps = new Properties ()
30-
31- // uncomment to see log4j LogLog output:
32- // logProps.put("log4j.debug", "true")
33- logProps.put(" log4j.rootLogger" , " INFO, logfile" )
34- logProps.put(" log4j.appender.logfile" , " org.apache.log4j.FileAppender" )
35- logProps.put(" log4j.appender.logfile.append" , append.toString)
36- logProps.put(" log4j.appender.logfile.file" , logFile)
37- logProps.put(" log4j.appender.logfile.threshold" , " INFO" )
38- logProps.put(" log4j.appender.logfile.layout" , " org.apache.log4j.PatternLayout" )
39- logProps.put(" log4j.appender.logfile.layout.ConversionPattern" , HailContext .logFormat)
40-
41- if (! quiet) {
42- logProps.put(" log4j.logger.Hail" , " INFO, HailConsoleAppender, HailSocketAppender" )
43- logProps.put(" log4j.appender.HailConsoleAppender" , " org.apache.log4j.ConsoleAppender" )
44- logProps.put(" log4j.appender.HailConsoleAppender.target" , " System.err" )
45- logProps.put(" log4j.appender.HailConsoleAppender.layout" , " org.apache.log4j.PatternLayout" )
46- } else
47- logProps.put(" log4j.logger.Hail" , " INFO, HailSocketAppender" )
48-
49- logProps.put(" log4j.appender.HailSocketAppender" , " is.hail.utils.StringSocketAppender" )
50- logProps.put(" log4j.appender.HailSocketAppender.layout" , " org.apache.log4j.PatternLayout" )
51-
52- LogManager .resetConfiguration()
53- PropertyConfigurator .configure(logProps)
54- }
55-
5621 def checkJavaVersion (): Unit = {
5722 val javaVersion = raw " (\d+)\.(\d+)\.(\d+).* " .r
5823 val versionString = System .getProperty(" java.version" )
@@ -97,7 +62,7 @@ object HailContext {
9762
9863 theContext = new HailContext (backend)
9964
100- info(s " Running Hail version ${theContext.version} " )
65+ info(s " Running Hail version $HAIL_PRETTY_VERSION " )
10166
10267 theContext
10368 }
@@ -115,8 +80,6 @@ class HailContext private (
11580) {
11681 def stop (): Unit = HailContext .stop()
11782
118- def version : String = is.hail.HAIL_PRETTY_VERSION
119-
12083 private [this ] def fileAndLineCounts (
12184 fs : FS ,
12285 regex : String ,
0 commit comments