summaryrefslogtreecommitdiffstats
path: root/anaconda_log.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-05-13 22:10:35 +0000
committerJeremy Katz <katzj@redhat.com>2002-05-13 22:10:35 +0000
commitda73685bbbc21d668413fb5b437045d5afa745bc (patch)
tree708ca1980aeabdfd22c038711b943bc6433f8175 /anaconda_log.py
parent2d198d3e3433eb785ebdcb9300d5bda7621e7511 (diff)
downloadanaconda-da73685bbbc21d668413fb5b437045d5afa745bc.tar.gz
anaconda-da73685bbbc21d668413fb5b437045d5afa745bc.tar.xz
anaconda-da73685bbbc21d668413fb5b437045d5afa745bc.zip
add tty3 output to a file (#62743)
Diffstat (limited to 'anaconda_log.py')
-rw-r--r--anaconda_log.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/anaconda_log.py b/anaconda_log.py
index 54a32eb51..e6a0ad900 100644
--- a/anaconda_log.py
+++ b/anaconda_log.py
@@ -18,9 +18,14 @@ import sys
class LogFile:
def __init__ (self):
self.logFile = None
+ self.logFile2 = None
def close (self):
- self.logFile.close ()
+ try:
+ self.logFile.close ()
+ self.logFile2.close()
+ except:
+ pass
def open (self, file):
if type(file) == type("hello"):
@@ -32,6 +37,10 @@ class LogFile:
self.logFile = file
else:
self.logFile = open("/dev/tty3", "w")
+ try:
+ self.logFile2 = open("/tmp/anaconda.log", "a")
+ except:
+ pass
def __call__ (self, format, *args):
if not self.logFile:
@@ -42,6 +51,13 @@ class LogFile:
else:
self.logFile.write ("* %s\n" % format)
+ if self.logFile2:
+ if args:
+ self.logFile2.write ("* %s\n" % (format % args))
+ else:
+ self.logFile2.write ("* %s\n" % format)
+ self.logFile2.flush()
+
def getFile (self):
return self.logFile.fileno ()