move fpdb-error-log and HUD-error to APPDATA, renamed as fpdb-errors.txt and HUD-errors.txt to be consistent

This commit is contained in:
sqlcoder 2010-02-02 21:53:03 +00:00
parent 96d0e0f181
commit fece7c9147
2 changed files with 16 additions and 10 deletions

View File

@ -35,9 +35,6 @@ import traceback
(options, argv) = Options.fpdb_options()
if not options.errorsToConsole:
print "Note: error output is being logged. Any major error will be reported there _only_."
import thread
import time
import string
@ -79,6 +76,14 @@ class HUD_main(object):
log = Configuration.get_logger("logging.conf", "hud", log_dir=self.config.dir_log)
log.info("HUD_main starting")
log.info("Using db name = %s" % (db_name))
if not options.errorsToConsole:
fileName = os.path.join(self.config.dir_log, 'HUD-errors.txt')
print "Note: error output is being diverted to\n"+fileName \
+ "\nAny major error will be reported there _only_.\n"
errorFile = open(fileName, 'w', 0)
sys.stderr = errorFile
self.hud_dict = {}
self.hud_params = self.config.get_hud_ui_parameters()

View File

@ -53,7 +53,7 @@ if os.name == 'nt':
raw_input("Press ENTER to continue.")
exit()
print "Python " + sys.version[0:3] + '...\n'
print "Python " + sys.version[0:3] + '...'
import traceback
import threading
@ -62,12 +62,6 @@ import string
cl_options = string.join(sys.argv[1:])
(options, argv) = Options.fpdb_options()
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_."
errorFile = open('fpdb-error-log.txt', 'w', 0)
sys.stderr = errorFile
#import logging
import logging, logging.config
try:
@ -910,6 +904,13 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
self.window.show()
self.load_profile()
if not options.errorsToConsole:
fileName = os.path.join(self.config.dir_log, 'fpdb-errors.txt')
print "\nNote: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in\n" \
+ self.config.dir_log + "Any major error will be reported there _only_.\n"
errorFile = open(fileName, 'w', 0)
sys.stderr = errorFile
self.statusIcon = gtk.StatusIcon()
if os.path.exists(os.path.join(sys.path[0], '../gfx/fpdb-cards.png')):
self.statusIcon.set_from_file(os.path.join(sys.path[0], '../gfx/fpdb-cards.png'))