Changeset 668 for branches


Ignore:
Timestamp:
Oct 23, 2007 8:28:34 AM (12 years ago)
Author:
stefan
Message:

allow to let messages go into a logfile instead of stdout

Location:
branches/testScripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBlogMessages.py

    r616 r668  
    22
    33import time
     4import NBuserConfig
    45
     6#TODO: one could open the logfile once in the beginning, set it to sys.stdout, flush after each message, and close it finally
    57
    68#------------------------------------------------------------------------
     
    1012  logMsg = time.ctime(time.time())+': '
    1113  logMsg += msg
    12   print logMsg
     14  if len(NBuserConfig.LOGFILE) == 0 or NBuserConfig.LOGFILE.isspace() :
     15    print logMsg
     16  else :
     17    logfile=open(NBuserConfig.NIGHTLY_BUILD_ROOT_DIR+'/'+NBuserConfig.LOGFILE, 'a')
     18    logfile.write(logMsg+'\n')
     19#    logfile.flush()
     20    logfile.close()
  • branches/testScripts/NBuserConfig.py

    r667 r668  
    2020  NIGHTLY_BUILD_ROOT_DIR = 'd:/nbTest'
    2121
     22#----------------------------------------------------------------------
     23# LOGFILE:
     24#   file where log messages from the nightlyBuild system will be stored
     25#   If no file is given, then we will print to stdout.
     26#   The LOGFILE will be used relative to the NIGHTLY_BUILD_ROOT_DIR, i.e.,
     27#   log will be written into NIGHTLY_BUILD_ROOT_DIR+'/'+LOGFILE
     28#----------------------------------------------------------------------
     29
     30LOGFILE=''
     31       
    2232#----------------------------------------------------------------------
    2333# Define directory where svn is located.
     
    145155
    146156
    147 ##NIGHTLY_BUILD_ROOT_DIR = userParameters.data['NIGHTLY_BUILD_ROOT_DIR']
    148 ##SMTP_SERVER_NAME = userParameters.data['SMTP_SERVER_NAME']
    149 ##SMTP_SERVER_PORT = userParameters.data['SMTP_SERVER_PORT']
    150 ##SMTP_SSL_SERVER = userParameters.data['SMTP_SSL_SERVER']
    151 ##SMTP_USER_NAME = userParameters.data['SMTP_USER_NAME']
    152 ##SMTP_PASSWORD_FILENAME = userParameters.data['SMTP_PASSWORD_FILENAME']
    153 ##SENDER_EMAIL_ADDR = userParameters.data['SENDER_EMAIL_ADDR']
    154 ##MY_EMAIL_ADDR =  userParameters.data['MY_EMAIL_ADDR']
    155 ##SEND_MAIL_TO_PROJECT_MANAGER = userParameters.data['SEND_MAIL_TO_PROJECT_MANAGER']
    156 ##SVNPATH_PREFIX = userParameters.data['SVNPATH_PREFIX']
    157 ##DOWNLOAD_3RD_PARTY = userParameters.data['DOWNLOAD_3RD_PARTY']
    158 ##CONFIGURE_FLAGS = userParameters.data['CONFIGURE_FLAGS']
     157# NIGHTLY_BUILD_ROOT_DIR = userParameters.data['NIGHTLY_BUILD_ROOT_DIR']
     158# SMTP_SERVER_NAME = userParameters.data['SMTP_SERVER_NAME']
     159# SMTP_SERVER_PORT = userParameters.data['SMTP_SERVER_PORT']
     160# SMTP_SSL_SERVER = userParameters.data['SMTP_SSL_SERVER']
     161# SMTP_USER_NAME = userParameters.data['SMTP_USER_NAME']
     162# SMTP_PASSWORD_FILENAME = userParameters.data['SMTP_PASSWORD_FILENAME']
     163# SENDER_EMAIL_ADDR = userParameters.data['SENDER_EMAIL_ADDR']
     164# MY_EMAIL_ADDR =  userParameters.data['MY_EMAIL_ADDR']
     165# SEND_MAIL_TO_PROJECT_MANAGER = userParameters.data['SEND_MAIL_TO_PROJECT_MANAGER']
     166# SVNPATH_PREFIX = userParameters.data['SVNPATH_PREFIX']
     167# DOWNLOAD_3RD_PARTY = userParameters.data['DOWNLOAD_3RD_PARTY']
     168# CONFIGURE_FLAGS = userParameters.data['CONFIGURE_FLAGS']
     169# LOGFILE = userParameters.data['LOGFILE']
  • branches/testScripts/userParametersEmpty.py

    r666 r668  
    1515'SEND_MAIL_TO_PROJECT_MANAGER':'',
    1616'SVNPATH_PREFIX': '',
    17 'DOWNLOAD_3RD_PARTY': ''
    18 'CONFIGURE_FLAGS': ''
     17'DOWNLOAD_3RD_PARTY': '',
     18'CONFIGURE_FLAGS': '',
     19'LOGFILE': ''
    1920}
Note: See TracChangeset for help on using the changeset viewer.