p140 - added CLI option to fpdb.py to control redirection of stderr
This commit is contained in:
parent
93b6f9ddaa
commit
c739395189
|
@ -17,7 +17,15 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
|
||||||
|
parser = OptionParser()
|
||||||
|
parser.add_option("-x", "--errorsToConsole", action="store_true",
|
||||||
|
help="If passed error output will go to the console rather than .")
|
||||||
|
(options, sys.argv) = parser.parse_args()
|
||||||
|
|
||||||
|
if not options.errorsToConsole:
|
||||||
print "Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_."
|
print "Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_."
|
||||||
errorFile = open('fpdb-error-log.txt', 'w', 0)
|
errorFile = open('fpdb-error-log.txt', 'w', 0)
|
||||||
sys.stderr = errorFile
|
sys.stderr = errorFile
|
||||||
|
|
|
@ -292,4 +292,4 @@ class Importer:
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print "CLI for fpdb_import is currently on vacation please check in later"
|
print "CLI for fpdb_import is now available as CliFpdb.py"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user