Changeset 6445 for hwdetector


Ignore:
Timestamp:
Dec 11, 2017, 4:50:01 PM (22 months ago)
Author:
mabarracus
Message:

Fix logger to file bug

Location:
hwdetector/trunk/fuentes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • hwdetector/trunk/fuentes/debian/changelog

    r6441 r6445  
     1hwdetector (0.1.7.1) xenial; urgency=medium
     2
     3  * Fix logger to file bug
     4
     5 -- M.Angel Juan <m.angel.juan@gmail.com>  Mon, 11 Dec 2017 16:49:23 +0100
     6
    17hwdetector (0.1.7) xenial; urgency=medium
    28
  • hwdetector/trunk/fuentes/hwdetector.install/hwdetector/utils/log.py

    r6399 r6445  
    22import sys
    33import logging
     4import os
    45try:
    56    import colorlog
     
    1314        self.level = logging.INFO
    1415        self.disabled = False
     16        self.filename_to_log = os.tempnam('/tmp','valentin-debug-log-messages-') + '.txt'
    1517        super(logger,self).__init__(*args,**kwargs)
    1618
     
    4850            )
    4951            self.l = logging.getLogger()
    50         fh=logging.FileHandler('/tmp/valentin-debug-log-messages.txt',mode='w')
     52
     53        fh=logging.FileHandler(self.filename_to_log,mode='w')
    5154        fh.setFormatter(self.l.handlers[0].formatter)
    5255        self.l.addHandler(fh)
  • hwdetector/trunk/fuentes/valentin.install/usr/bin/valentin

    r6441 r6445  
    9393            with tarfile.open(filename,'w:gz') as f:
    9494                f.add(file,arcname='debug-info-{}.txt'.format(datestr),recursive=False)
    95                 logger_message_file='/tmp/valentin-debug-log-messages.txt'
     95                logger_message_file=log.filename_to_log
    9696                if os.path.exists(logger_message_file):
    97                     f.add(logger_message_file,arcname=os.path.basename(logger_message_file))
     97                    f.add(logger_message_file,arcname=os.path.basename('valentin-debug-log-messages.txt'))
    9898            return filename
    9999    except Exception as e:
Note: See TracChangeset for help on using the changeset viewer.