~mmcg069/software-center/star-tweaks

« back to all changes in this revision

Viewing changes to softwarecenter/log.py

  • Committer: Matthew McGowan
  • Date: 2011-03-23 10:45:21 UTC
  • mfrom: (1556.1.62 trunk)
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110323104521-0lysrjm8kudev4nb
merge w trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
if not os.path.exists(SOFTWARE_CENTER_CACHE_DIR):
90
90
    os.makedirs(SOFTWARE_CENTER_CACHE_DIR)
91
91
logfile_path = os.path.join(SOFTWARE_CENTER_CACHE_DIR, "software-center.log")
 
92
 
 
93
# according to bug 688682 many people have a non-writeable logfile
 
94
if os.path.exists(logfile_path) and not os.access(logfile_path, os.W_OK):
 
95
    try:
 
96
        logging.warn("trying to fix non-writeable logfile")
 
97
        os.remove(logfile_path)
 
98
    except:
 
99
        logging.exception("failed to fix non-writeable logfile")
 
100
 
92
101
logfile_handler = logging.handlers.RotatingFileHandler(logfile_path,
93
102
                                                       maxBytes=100*1000,
94
103
                                                       backupCount=5)